Current email: {{ loginForm.email().value() }}
+``` + +Each field exposes: + +- `value()` +- `valid()` +- `errors()` +- `dirty()` +- `touched()` + +All as signals. + +--- + +### 4. Updating Form Models Programmatically + +Signal Forms allow three update methods. + +#### 1. Replace the entire model + +```ts +this.userModel.set({ + name: 'Alice', + email: 'alice@example.com', +}); +``` + +#### 2. Patch specific fields + +```ts +this.userModel.update(prev => ({ + ...prev, + email: newEmail, +})); +``` + +#### 3. Update a single field + +```ts +this.userForm.email().value.set(''); +``` + +This eliminates the need for: + +- `patchValue()` +- `setValue()` +- `formGroup.get('field')` + +--- + +### 5. Automatic Two-Way Binding With `[field]` + +The `[field]` directive enables perfect two-way data binding: + +```html + +``` + +#### How it works: + +- **User input → Field state → Model** +- **Model updates → Field state → Input UI** + +No subscriptions. +No event handlers. +No boilerplate. + +Reactive Forms could never achieve this cleanly. + +--- + +### 6. Nested Models and Arrays + +Models can contain nested object structures: + +```ts +userModel = signal({ + name: '', + address: { + street: '', + city: '', + }, +}); +``` + +Access fields easily: + +```html + +``` + +Arrays are also supported: + +```ts +orderModel = signal({ + items: [ + { product: '', quantity: 1, price: 0 } + ] +}); +``` + +Field state persists even when array items move, thanks to identity tracking. + +--- + +### 7. Schema-Based Validation + +Validation is clean and centralized: + +```ts +import { required, email } from '@angular/forms/signals'; + +const model = signal({ email: '' }); + +const formRef = form(model, { + email: [required(), email()], +}); +``` + +Field validation state is reactive: + +```ts +formRef.email().valid() +formRef.email().errors() +formRef.email().touched() +``` + +Validation no longer scatters across components. + +--- + +### 8. When Should You Use Signal Forms? + +#### New Angular 21+ apps +Signal-first architecture is the new standard. + +#### Teams wanting stronger type safety +Every field is exactly typed. + +#### Devs tired of Reactive Form boilerplate +Signal Forms drastically simplify code. + +#### Complex UI with computed reactive form state +Signals integrate perfectly. + +#### ❌ Avoid if: +- You need long-term stability +- You rely on mature Reactive Forms features +- Your app must avoid experimental APIs + +--- + +### 9. Reactive Forms vs Signal Forms + +| Feature | Reactive Forms | Signal Forms | +|--------|----------------|--------------| +| Boilerplate | High | Very low | +| Type-safety | Weak | Strong | +| Two-way binding | Manual | Automatic | +| Validation | Scattered | Centralized schema | +| Nested forms | Verbose | Natural | +| Subscriptions | Required | None | +| Change detection | Zone-heavy | Fine-grained | + +Signal Forms feel like the "modern Angular mode," while Reactive Forms increasingly feel legacy. + +--- + +### 10. Full Example: Login Form + +```ts +@Component({ + selector: 'app-login', + imports: [Field], + template: ` + + `, +}) +export class LoginComponent { + model = signal({ email: '', password: '' }); + form = form(this.model); + + submit() { + console.log(this.model()); + } +} +``` + +Minimal. Reactive. Completely type-safe. + +--- + +## **Conclusion** + +Signal Forms in Angular 21 represent a big step forward: + +- Cleaner API +- Stronger type safety +- Automatic two-way binding +- Centralized validation +- Fine-grained reactivity +- Dramatically better developer experience + + +Although these are experimental, they clearly show the future of Angular's form ecosystem. +Once you get into using Signal Forms, you may never want to use Reactive Forms again. + +--- diff --git a/docs/en/Community-Articles/2025-11-19-ABP-BLACK-FRIDAY-BLOG/post.md b/docs/en/Community-Articles/2025-11-19-ABP-BLACK-FRIDAY-BLOG/post.md new file mode 100644 index 0000000000..153470666f --- /dev/null +++ b/docs/en/Community-Articles/2025-11-19-ABP-BLACK-FRIDAY-BLOG/post.md @@ -0,0 +1,25 @@ +**ABP Black Friday Deals are Almost Here\!** + +The season of huge savings is back\! We are happy to announce **ABP Black Friday Campaign**, packed with exclusive deals that you simply won't want to miss. Whether you are ready to start building with ABP or looking to expand your existing license, this is your chance to maximize your savings\! + +**Campaign Dates: Mark Your Calendar** + +Black Friday campaign is live for one week only\! Our deals run from: **November 24th \- December 1st.** + +Don't miss this limited-time opportunity to **save up to $3,000** and take your software development to the next level. + +**What's Included in the ABP Black Friday Campaign?** + +Here’s why this campaign is the best time to buy or upgrade: + +* Open to Everyone: This campaign is available for both new and existing customers. +* Stack Your Savings: You can combine this Black Friday offer with our multi-year discounts for the greatest possible value. +* Flexible Upgrades: Planning to upgrade to a higher package? Now is the perfect time to make that move at a lower cost. +* More Developer Seats? No Problem\! Additional developer seats are also eligible under this campaign, allowing you to grow your team effortlessly and affordably. + +**Save Money Now\!** + +This campaign is your best opportunity all year to unlock advanced features, scale your team, or upgrade your plan while **saving up to $3,000.** Secure your savings before the campaign ends on December 1st\! + +[**Visit Pricing Page to Explore Offers\!**](https://abp.io/pricing) + diff --git a/docs/en/Community-Articles/2025-11-21-AntiGravity/Post.md b/docs/en/Community-Articles/2025-11-21-AntiGravity/Post.md new file mode 100644 index 0000000000..d5e34e7892 --- /dev/null +++ b/docs/en/Community-Articles/2025-11-21-AntiGravity/Post.md @@ -0,0 +1,158 @@ +# My First Look and Experience with Google AntiGravity + +## Is Google AntiGravity Going to Replace Your Main Code Editor? + +Today, I tried the new code-editor AntiGravity by Google. *"It's beyond a code-editor*" by Google 🙄 +When I first launch it, I see the UI is almost same as Cursor. They're both based on Visual Studio Code. +That's why it was not hard to find what I'm looking for. + +First of all, the main difference as I see from the Cursor is; when I type a prompt in the agent section **AntiGravity first creates a Task List** (like a road-map) and whenever it finishes a task, it checks the corresponding task. Actually Cursor has a similar functionality but AntiGravity took it one step further. + +Second thing which was good to me; AntiGravity uses [Nano Banana 🍌](https://gemini.google/tr/overview/image-generation/). This is Google's AI image generation model... Why it's important because when you create an app, you don't need to search for graphics, deal with image licenses. **AntiGravity generates images automatically and no license is required!** + +Third exciting feature for me; **AntiGravity is integrated with Google Chrome and can communicate with the running website**. When I first run my web project, it installed a browser extension which can see and interact with my website. It can see the results, click somewhere else on the page, scroll, fill up the forms, amazing 😵 + +Another feature I loved is that **you can enter a new prompt even while AntiGravity is still generating a response** 🧐. It instantly prioritizes the latest input and adjusts the ongoing process if needed. But in Cursor, if you add a prompt before the cursor finishes, it simply queues it and runs it later 😔. + +And lastly, **AntiGravity is working very good with Gemini 3**. + +Well, everything was not so perfect 😥 When I tried AntiGravity, couple of times it stucked AI generation and Agent stopped. I faced errors like this 👇 + + + + + +## Debugging .NET Projects via AntiGravity + +⚠ There's a crucial development issue with AntiGravity (and also for Cursor, Windsurf etc...) 🤕 you **cannot debug your .NET application with AntiGravity 🥺.** *This is Microsoft's policy!* Microsoft doesn't allow debugging for 3rd party IDEs and shows the below error... That's why I cannot say it's a downside of AntiGravity. You need to use Microsft's original VS Code, Visual Studio or Rider for debugging. But wait a while there's a workaround for this, I'll let you know in the next section. + + + + + +### What does this error mean? + +AntiGravity, Cursor, Windsurf etc... are using Visual Studio Code and the C# extension for VS Code includes the Microsoft .NET Core Debugger "*vsdbg*". +VS Code is open-source but "*vsdbg*" is not open-source! It's working only with Visual Studio Code, Visual Studio and Visual Studio for Mac. This is clearly stated at [Microsoft's this link](https://github.com/dotnet/vscode-csharp/blob/main/docs/debugger/Microsoft-.NET-Core-Debugger-licensing-and-Microsoft-Visual-Studio-Code.md). + +### Ok! How to resolve debugging issue with AntiGravity? and Cursor and Windsurf... + +There's a free C# debugger extension for Visual Studio Code based IDEs that supports AntiGravity, Cursor and Windsurf. The extension name is **C#**. +You can download this free C# debugger extension at 👉 [open-vsx.org/extension/muhammad-sammy/csharp/](https://open-vsx.org/extension/muhammad-sammy/csharp/). +For AntiGravity open Extension window (*Ctrl + Shift + X*) and search for `C#`, there you'll see this extension. + + + +After installing, I restarted AntiGravity and now I can see the red circle which allows me to add breakpoint on C# code. + + + +### Another Extension For Debugging .NET Apps on VS Code + +Recently I heard about DotRush extension from the folks. As they say DotRush works slightly faster and support Razor pages (.cshtml files). +Here's the link for DotRush https://github.com/JaneySprings/DotRush + +### Finding Website Running Port + +When you run the web project via C# debugger extension, normally it's not using the `launch.json` therefore the website port is not the one when you start from Visual Studio / Rider... So what's my website's port which I just run now? Normally for ASP.NET Core **the default port is 5000**. You can try navigating to http://localhost:5000/. +Alternatively you can write the below code in `Program.cs` which prints the full address of your website in the logs. +If you do the steps which I showed you, you can debug your C# application via AntiGravity and other VS Code derivatives. + + + +## How Much is AntiGravity? 💲 + +Currently there's only individual plan is available for personal accounts and that's free 👏! The contents of Team and Enterprise plans and prices are not announced yet. But **Gemini 3 is not free**! I used it with my company's Google Workspace account which we normally pay for Gemini. + + + +## More About AntiGravity + +There have been many AI assisted IDEs like [Windsurf](https://windsurf.com/), [Cursor](https://cursor.com/), [Zed](https://zed.dev/), [Replit](https://replit.com/) and [Fleet](https://www.jetbrains.com/fleet/). But this time it's different, this is backed by Google. +As you see from the below image AntiGravity, uses a standard grid layout as others based on VS Code editor. +It's very similar to Cursor, Visual Studio, Rider. + + + +## Supported LLMs 🧠 + +Antigravity offers the below models which supports reasoning: Gemini 3 Pro, Claude Sonnet 4.5, GPT-OSS + + + +Antigravity uses other models for supportive tasks in the background: + +- **Nano banana**: This is used to generate images. +- **Gemini 2.5 Pro UI Checkpoint**: It's for the browser subagent to trigger browser action such as clicking, scrolling, or filling in input. +- **Gemini 2.5 Flash**: For checkpointing and context summarization, this is used. +- **Gemini 2.5 Flash Lite**: And when it's need to make a semantic search in your code-base, this is used. + +## AntiGravity Can See Your Website + +This makes a big difference from traditional IDEs. AntiGravity's browser agent is taking screenshots of your pages when it needs to check. This is achieved by a Chrome Extension as a tool to the agent, and you can also prompt the agent to take a screenshot of a page. It can iterate on website designs and implementations, it can perform UI Testing, it can monitor dashboards, it can automate routine tasks like rerunning CI. +This is the link for the extension 👉 [chromewebstore.google.com/detail/antigravity-browser-exten/eeijfnjmjelapkebgockoeaadonbchdd](https://chromewebstore.google.com/detail/antigravity-browser-exten/eeijfnjmjelapkebgockoeaadonbchdd). AntiGravity will install this extension automatically on the first run. + + + + + +## MCP Integration + +### When Do We Need MCP in a Code Editor? + +Simply if we want to connect to a 3rd party service to complete our task we need MCP. So AntiGravity can connect to your DB and write proper SQL queries or it can pull in recent build logs from Netlify or Heroku. Also you can ask AntiGravity to to connect GitHub for finding the best authentication pattern. + +### AntiGravity Supports These MCP Servers + +Airweave, AlloyDB for PostgreSQL, Atlassian, BigQuery, Cloud SQL for PostgreSQL, Cloud SQL for MySQL, Cloud SQL for SQL Server, Dart, Dataplex, Figma Dev Mode MCP, Firebase, GitHub, Harness, Heroku, Linear, Locofy, Looker, MCP Toolbox for Databases, MongoDB, Neon, Netlify, Notion, PayPal, Perplexity Ask, Pinecone, Prisma, Redis, Sequential Thinking, SonarQube, Spanner, Stripe and Supabase. + + + +## Agent Settings ⚙️ + +The major settings of Agent are: + +- **Agent Auto Fix Lints**: I enabled this setting because I want the Agent automatically fixes its own mistakes for invalid syntax, bad formatting, unused variables, unreachable code or following coding standards... It makes extra tool calls that's why little bit expensive 🥴. +- **Auto Execution**: Sometimes Agent tries to build application or writing test code and running it, in these cases it executes command. I choose "Turbo" 🤜 With this option, Agent always runs the terminal command and controls my browser. +- **Review Policy**: How much control you are giving to agent 🙎. I choose "Always Proceed" 👌 because I mostly trust AI 😀. The Agent will never ask for review. + + + +## Differences Between Cursor and AntiGravity + +While Cursor was the champion of AI code editors, **Antigravity brings a different philosophy**. + +### 1. "Agent-First 🤖" vs "You-First 🤠" + +- **Cursor:** It acts like an assistant; it predicts your next move, auto-completes your thoughts, and helps you refactor while you type. You are still the driver; Cursor just drives the car at 200 km/h. +- **Antigravity:** Antigravity is built to let you manage coding tasks. It is "Agent-First." You don't just type code; you assign tasks to autonomous agents (e.g., "Fix the bug in the login flow and verify it in the browser"). It behaves more like a junior developer that you supervise. + +### 2. The Interface + +- **Cursor:** Looks and feels exactly like **VS Code**. If you know VS Code, you know Cursor. + +- **Antigravity:** Introduces 2 major layouts: + - **Editor View:** Similar to a standard IDE + - **Manager View:** A dashboard where you see multiple "Agents" working in parallel. You can watch them plan, execute, and test tasks asynchronously. + +### 3. Verification & Trust + +- **Cursor:** You verify by reading the code diffs it suggests. +- **Antigravity:** Introduces **Artifacts**... Since the agents work autonomously, they generate proof-of-work documents, screenshots of the app running, browser logs and execution plans. So you can verify what they did without necessarily reading every line of code immediately. + +### 4. Capabilities + +- **Cursor:** Best-in-class **Autocomplete** ("Tab" feature) and **Composer** (multi-file editing). It excels at "Vibe Coding". It's getting into a flow state where the AI writes the boilerplate and you direct the logic. +- **Antigravity:** Is good at **Autonomous Execution**. It has a built-in browser and terminal that the *Agent* controls. The Agent can write code, run the server, open the browser, see the error, and fix it 😎 + +### 5. AI Models (Brains 🧠) + +- **Cursor:** Model Agnostic. You can switch between **Claude 3.5 Sonnet** *-mostly the community uses this-*, GPT-4o, and others. +- **Antigravity:** Built deeply around **Gemini 3 Pro**. It leverages Gemini's massive context window (1M+ tokens) to understand huge mono repos without needing as much "RAG" as Cursor. + + + +## Try It Yourself Now 🤝 + +If you are ready to experience the new AI code editor by Google, download and use 👇 +[**Launch Google AntiGravity**](https://antigravity.google/) \ No newline at end of file diff --git a/docs/en/Community-Articles/2025-11-21-AntiGravity/agent-settings.png b/docs/en/Community-Articles/2025-11-21-AntiGravity/agent-settings.png new file mode 100644 index 0000000000..a659c244c5 Binary files /dev/null and b/docs/en/Community-Articles/2025-11-21-AntiGravity/agent-settings.png differ diff --git a/docs/en/Community-Articles/2025-11-21-AntiGravity/anti-gravity-ui.png b/docs/en/Community-Articles/2025-11-21-AntiGravity/anti-gravity-ui.png new file mode 100644 index 0000000000..885284dd56 Binary files /dev/null and b/docs/en/Community-Articles/2025-11-21-AntiGravity/anti-gravity-ui.png differ diff --git a/docs/en/Community-Articles/2025-11-21-AntiGravity/breakpoint.png b/docs/en/Community-Articles/2025-11-21-AntiGravity/breakpoint.png new file mode 100644 index 0000000000..0ef01d71a3 Binary files /dev/null and b/docs/en/Community-Articles/2025-11-21-AntiGravity/breakpoint.png differ diff --git a/docs/en/Community-Articles/2025-11-21-AntiGravity/cover.png b/docs/en/Community-Articles/2025-11-21-AntiGravity/cover.png new file mode 100644 index 0000000000..b2ec245a2f Binary files /dev/null and b/docs/en/Community-Articles/2025-11-21-AntiGravity/cover.png differ diff --git a/docs/en/Community-Articles/2025-11-21-AntiGravity/csharp-debug-extension.png b/docs/en/Community-Articles/2025-11-21-AntiGravity/csharp-debug-extension.png new file mode 100644 index 0000000000..6807c3f6bc Binary files /dev/null and b/docs/en/Community-Articles/2025-11-21-AntiGravity/csharp-debug-extension.png differ diff --git a/docs/en/Community-Articles/2025-11-21-AntiGravity/debug.png b/docs/en/Community-Articles/2025-11-21-AntiGravity/debug.png new file mode 100644 index 0000000000..c4674a89f3 Binary files /dev/null and b/docs/en/Community-Articles/2025-11-21-AntiGravity/debug.png differ diff --git a/docs/en/Community-Articles/2025-11-21-AntiGravity/errors.png b/docs/en/Community-Articles/2025-11-21-AntiGravity/errors.png new file mode 100644 index 0000000000..f8c2e43dac Binary files /dev/null and b/docs/en/Community-Articles/2025-11-21-AntiGravity/errors.png differ diff --git a/docs/en/Community-Articles/2025-11-21-AntiGravity/extension-features.png b/docs/en/Community-Articles/2025-11-21-AntiGravity/extension-features.png new file mode 100644 index 0000000000..cd0b07cabf Binary files /dev/null and b/docs/en/Community-Articles/2025-11-21-AntiGravity/extension-features.png differ diff --git a/docs/en/Community-Articles/2025-11-21-AntiGravity/extension.png b/docs/en/Community-Articles/2025-11-21-AntiGravity/extension.png new file mode 100644 index 0000000000..601a28849a Binary files /dev/null and b/docs/en/Community-Articles/2025-11-21-AntiGravity/extension.png differ diff --git a/docs/en/Community-Articles/2025-11-21-AntiGravity/find-website-port.png b/docs/en/Community-Articles/2025-11-21-AntiGravity/find-website-port.png new file mode 100644 index 0000000000..183e8c6f5b Binary files /dev/null and b/docs/en/Community-Articles/2025-11-21-AntiGravity/find-website-port.png differ diff --git a/docs/en/Community-Articles/2025-11-21-AntiGravity/image-20251123185724281.png b/docs/en/Community-Articles/2025-11-21-AntiGravity/image-20251123185724281.png new file mode 100644 index 0000000000..82b8f478e1 Binary files /dev/null and b/docs/en/Community-Articles/2025-11-21-AntiGravity/image-20251123185724281.png differ diff --git a/docs/en/Community-Articles/2025-11-21-AntiGravity/llms.png b/docs/en/Community-Articles/2025-11-21-AntiGravity/llms.png new file mode 100644 index 0000000000..82b8f478e1 Binary files /dev/null and b/docs/en/Community-Articles/2025-11-21-AntiGravity/llms.png differ diff --git a/docs/en/Community-Articles/2025-11-21-AntiGravity/mcp.png b/docs/en/Community-Articles/2025-11-21-AntiGravity/mcp.png new file mode 100644 index 0000000000..06a343f068 Binary files /dev/null and b/docs/en/Community-Articles/2025-11-21-AntiGravity/mcp.png differ diff --git a/docs/en/Community-Articles/2025-11-21-AntiGravity/pricing.png b/docs/en/Community-Articles/2025-11-21-AntiGravity/pricing.png new file mode 100644 index 0000000000..0b552352e3 Binary files /dev/null and b/docs/en/Community-Articles/2025-11-21-AntiGravity/pricing.png differ diff --git a/docs/en/Community-Articles/2025-11-22-building-production-ready-llm-applications/coverimage.png b/docs/en/Community-Articles/2025-11-22-building-production-ready-llm-applications/coverimage.png new file mode 100644 index 0000000000..b264e259e9 Binary files /dev/null and b/docs/en/Community-Articles/2025-11-22-building-production-ready-llm-applications/coverimage.png differ diff --git a/docs/en/Community-Articles/2025-11-22-building-production-ready-llm-applications/images/chat-history-hybrid.svg b/docs/en/Community-Articles/2025-11-22-building-production-ready-llm-applications/images/chat-history-hybrid.svg new file mode 100644 index 0000000000..ab1bb36114 --- /dev/null +++ b/docs/en/Community-Articles/2025-11-22-building-production-ready-llm-applications/images/chat-history-hybrid.svg @@ -0,0 +1,114 @@ + \ No newline at end of file diff --git a/docs/en/Community-Articles/2025-11-22-building-production-ready-llm-applications/images/mcp-architecture.svg b/docs/en/Community-Articles/2025-11-22-building-production-ready-llm-applications/images/mcp-architecture.svg new file mode 100644 index 0000000000..ee590d27eb --- /dev/null +++ b/docs/en/Community-Articles/2025-11-22-building-production-ready-llm-applications/images/mcp-architecture.svg @@ -0,0 +1,150 @@ + \ No newline at end of file diff --git a/docs/en/Community-Articles/2025-11-22-building-production-ready-llm-applications/images/multilingual-rag.svg b/docs/en/Community-Articles/2025-11-22-building-production-ready-llm-applications/images/multilingual-rag.svg new file mode 100644 index 0000000000..81173091f0 --- /dev/null +++ b/docs/en/Community-Articles/2025-11-22-building-production-ready-llm-applications/images/multilingual-rag.svg @@ -0,0 +1,135 @@ + \ No newline at end of file diff --git a/docs/en/Community-Articles/2025-11-22-building-production-ready-llm-applications/images/pgvector-integration.svg b/docs/en/Community-Articles/2025-11-22-building-production-ready-llm-applications/images/pgvector-integration.svg new file mode 100644 index 0000000000..2903740e57 --- /dev/null +++ b/docs/en/Community-Articles/2025-11-22-building-production-ready-llm-applications/images/pgvector-integration.svg @@ -0,0 +1,112 @@ + \ No newline at end of file diff --git a/docs/en/Community-Articles/2025-11-22-building-production-ready-llm-applications/images/rag-parent-child.svg b/docs/en/Community-Articles/2025-11-22-building-production-ready-llm-applications/images/rag-parent-child.svg new file mode 100644 index 0000000000..752c2c42b1 --- /dev/null +++ b/docs/en/Community-Articles/2025-11-22-building-production-ready-llm-applications/images/rag-parent-child.svg @@ -0,0 +1,118 @@ + \ No newline at end of file diff --git a/docs/en/Community-Articles/2025-11-22-building-production-ready-llm-applications/images/reasoning-effort-diagram.svg b/docs/en/Community-Articles/2025-11-22-building-production-ready-llm-applications/images/reasoning-effort-diagram.svg new file mode 100644 index 0000000000..fc6a18d68d --- /dev/null +++ b/docs/en/Community-Articles/2025-11-22-building-production-ready-llm-applications/images/reasoning-effort-diagram.svg @@ -0,0 +1,60 @@ + \ No newline at end of file diff --git a/docs/en/Community-Articles/2025-11-22-building-production-ready-llm-applications/images/svg-diagram-example.svg b/docs/en/Community-Articles/2025-11-22-building-production-ready-llm-applications/images/svg-diagram-example.svg new file mode 100644 index 0000000000..6087893702 --- /dev/null +++ b/docs/en/Community-Articles/2025-11-22-building-production-ready-llm-applications/images/svg-diagram-example.svg @@ -0,0 +1,149 @@ + \ No newline at end of file diff --git a/docs/en/Community-Articles/2025-11-22-building-production-ready-llm-applications/post.md b/docs/en/Community-Articles/2025-11-22-building-production-ready-llm-applications/post.md new file mode 100644 index 0000000000..8fa2067d01 --- /dev/null +++ b/docs/en/Community-Articles/2025-11-22-building-production-ready-llm-applications/post.md @@ -0,0 +1,414 @@ +# Building Production-Ready LLM Applications with .NET: A Practical Guide + +Large Language Models (LLMs) have evolved rapidly, and integrating them into production .NET applications requires staying current with the latest approaches. In this article, I'll share practical tips and patterns I've learned while building LLM-powered systems, covering everything from API changes in GPT-5 to implementing efficient RAG (Retrieval Augmented Generation) architectures. + +Whether you're building a chatbot, a knowledge base assistant, or integrating AI into your enterprise applications, these production-tested insights will help you avoid common pitfalls and build more reliable systems. + +## The Temperature Paradigm Shift: GPT-5 Changes Everything + +If you've been working with GPT-4 or earlier models, you're familiar with the `temperature` and `top_p` parameters for controlling response randomness. **Here's the critical update**: GPT-5 no longer supports these parameters! + +### The Old Way (GPT-4) +```csharp +var chatRequest = new ChatOptions +{ + Temperature = 0.7, // ✅ Worked with GPT-4 + TopP = 0.9 // ✅ Worked with GPT-4 +}; +``` + +### The New Way (GPT-5) +```csharp +var chatRequest = new ChatOptions +{ + RawRepresentationFactory = (client => new ChatCompletionOptions() + { +#pragma warning disable OPENAI001 + ReasoningEffortLevel = "minimal", +#pragma warning restore OPENAI001 + }) +}; +``` + +**Why the change?** GPT-5 incorporates an internal reasoning and verification process. Instead of controlling randomness, you now specify how much computational effort the model should invest in reasoning through the problem. + + + +### Choosing the Right Reasoning Level + +- **Low**: Quick responses for simple queries (e.g., "What's the capital of France?") +- **Medium**: Balanced approach for most use cases +- **High**: Complex reasoning tasks (e.g., code generation, multi-step problem solving) + +> **Pro Tip**: Reasoning tokens are included in your API costs. Use "High" only when necessary to optimize your budget. + +## System Prompts: The "Lost in the Middle" Problem + +Here's a critical insight that can save you hours of debugging: **Important rules must be repeated at the END of your prompt!** + +### ❌ What Doesn't Work +``` +You are a helpful assistant. +RULE: Never share passwords or sensitive information. + +[User Input] +``` + +### ✅ What Actually Works +``` +You are a helpful assistant. +RULE: Never share passwords or sensitive information. + +[User Input] + +⚠️ REMINDER: Apply the rules above strictly, ESPECIALLY regarding passwords. +``` + +**Why?** LLMs suffer from the "Lost in the Middle" phenomenon—they pay more attention to the beginning and end of the context window. Critical instructions buried in the middle are often ignored. + +## RAG Architecture: The Parent-Child Pattern + +Retrieval Augmented Generation (RAG) is essential for grounding LLM responses in your own data. The most effective pattern I've found is the **Parent-Child approach**. + + + +### How It Works + +1. **Split documents into hierarchies**: + - **Parent chunks**: Large sections (1000-2000 tokens) for context + - **Child chunks**: Small segments (200-500 tokens) for precise retrieval + +2. **Store both in vector database** with references + +3. **Query flow**: + - Search using child chunks (higher precision) + - Return parent chunks to LLM (richer context) + +### The Overlap Strategy + +Always use overlapping chunks to prevent information loss at boundaries! + +``` +Chunk 1: Token 0-500 +Chunk 2: Token 400-900 ← 100 token overlap +Chunk 3: Token 800-1300 ← 100 token overlap +``` + +**Standard recommendation**: 10-20% overlap (for 500 tokens, use 50-100 token overlap) + +### Implementation with Semantic Kernel + +```csharp +using Microsoft.SemanticKernel.Text; + +var chunks = TextChunker.SplitPlainTextParagraphs( + documentText, + maxTokensPerParagraph: 500, + overlapTokens: 50 +); + +foreach (var chunk in chunks) +{ + var embedding = await embeddingService.GenerateEmbeddingAsync(chunk); + await vectorDb.StoreAsync(chunk, embedding); +} +``` + +## PostgreSQL + pgvector: The Pragmatic Choice + +For .NET developers, choosing a vector database can be overwhelming. After evaluating multiple options, **PostgreSQL with pgvector** is the most practical choice for most scenarios. + + + +### Why pgvector? + +✅ **Use existing SQL knowledge** - No new query language to learn +✅ **EF Core integration** - Works with your existing data access layer +✅ **JOIN with metadata** - Combine vector search with traditional queries +✅ **WHERE clause filtering** - Filter by tenant, user, date, etc. +✅ **ACID compliance** - Transaction support for data consistency +✅ **No separate infrastructure** - One database for everything + +### Setting Up pgvector with EF Core + +First, install the NuGet package: + +```bash +dotnet add package Pgvector.EntityFrameworkCore +``` + +Define your entity: + +```csharp +using Pgvector; +using Pgvector.EntityFrameworkCore; + +public class DocumentChunk +{ + public Guid Id { get; set; } + public string Content { get; set; } + public Vector Embedding { get; set; } // 👈 pgvector type + public Guid ParentChunkId { get; set; } + public DateTime CreatedAt { get; set; } +} +``` + +Configure in DbContext: + +```csharp +protected override void OnModelCreating(ModelBuilder builder) +{ + builder.HasPostgresExtension("vector"); + + builder.Entity