Microsoft Reactor Livestream: Building AI Agents with Microsoft Agent Framework and Postgres

I did a livestream for Microsoft Reactor on building AI agents using the Microsoft Agent Framework and Postgres. The recording is now available.


All the code is available on GitHub: github.com/schneidenbach/using-agent-framework-with-postgres-microsoft-reactor

What we covered

The talk walks through building AI agents in C# using Microsoft’s Agent Framework (still in preview). Here’s a breakdown of what’s in the repo:

Demo 1: Basic Agent - A customer support agent with function tools. Shows how agents are defined with instructions (system prompt), model type, and tools (C# functions).

Demo 2: Sequential Agents - Chained agents: Draft, Review, Polish. Also covers observability with Jaeger tracing.

Demo 3: Postgres Chat Store - Storing conversation history in Postgres instead of relying on OpenAI’s thread storage. Why? Retention policies are unclear, you can’t query across threads, and you can’t summarize-and-continue without starting a new thread.

Demo 4: RAG with Hybrid Search - Using pgvector for similarity search combined with full-text search. The solution uses a hybrid approach because RAG is not an easy problem with a single solution.

Why Postgres?

Postgres with pgvector handles both your relational data needs and vector similarity search. You get:

  • Chat thread storage with full query capabilities
  • Vector embeddings for semantic search
  • Full-text search for keyword matching
  • Hybrid search combining both approaches

Azure Database for PostgreSQL Flexible Server supports pgvector out of the box. For local development, the demos use Testcontainers with Docker.

Running the demos

The repo has six projects. Set your Azure OpenAI credentials:

export REACTOR_TALK_AZURE_OPENAI_ENDPOINT="https://your-resource.openai.azure.com/"
export REACTOR_TALK_AZURE_OPENAI_API_KEY="your-api-key"

Projects 3 and 4 need Docker for Testcontainers. The “External” variants connect to your own Postgres instance if you prefer.

Key takeaways

  • Agent Framework provides abstractions for common patterns but is still in preview
  • Store your own chat threads rather than relying on LLM provider storage
  • Hybrid search (vector + full-text) often works better than pure semantic search, but there’s no RAG silver bullet

The slides are in the repo as a PDF if you want to follow along.

Enjoy!