Skip to main content

5 posts tagged with "dotnet"

View All Tags

Vector search in the Postgres you already run

· 9 min read

When a RAG prototype outgrows its in-memory list, the usual next step is a new piece of infrastructure: a dedicated vector database, with its own deployment, its own backups and a sync job that copies data into it. If you already run Postgres, there is a shorter step. pgvector adds a vector type, distance operators and approximate indexes to the database you already have, and the vectors sit in the same rows as the text they describe.

This post is what I would want to know before putting it in production: the column, the operators, the indexes and their knobs, the filtering trap, and how it looks from .NET.

RAG without the magic

· 8 min read

Retrieval-augmented generation sounds like a product category. It is a short pipeline: find the pieces of your own text that look related to a question, paste them into the prompt, and ask the model to answer from them and nothing else.

Frameworks that sell RAG hide those steps behind one call. That is convenient until an answer is wrong and you can't tell which step failed. So here is the whole thing in plain C#, one step at a time, with what each step is for and where it breaks.

Streaming LLM answers to the browser with Server-Sent Events

· 9 min read

A model writes its answer one token at a time. If your API waits for the last token before it returns anything, the user stares at a spinner for the whole generation, even though the first sentence was ready long before.

Streaming fixes that, and in ASP.NET Core it is now a few lines of code. The interesting parts are around those lines: which transport to use, what happens when the user closes the tab, what proxies do to a long response, and what "resume the stream" actually asks of your server.

Getting structured data out of an LLM

· 9 min read

A lot of useful LLM work is not conversation at all. You hand the model an invoice, a contract or an email and you want fields back: a number, a date, a list of lines, something your code can store and add up. The model is good at reading messy documents. It is not, by default, good at handing back something a program can rely on.

The gap between those two is where most extraction code goes wrong. This post walks through closing it in C#, with an invoice as the running example: ask for a shape, check what comes back as if a stranger sent it, retry with a reason, and know when to stop and ask a person.

Why I built the Orion family

· 5 min read

Most .NET backends end up needing the same dozen things: validation, a distributed lock, an audit trail, an outbox, encrypted columns, typed IDs, idempotent endpoints, rate limits, retries. Each team builds them again, a little differently, and each version is wrong in its own small way.

The Orion family is my answer to that: small, focused libraries for those problems, built to one quality bar and published on NuGet.