Skip to content

Part 3: hands-on RAG console app (#500)#510

Merged
jongalloway merged 1 commit into
mainfrom
feature/500-part3-manual-rag
Jul 3, 2026
Merged

Part 3: hands-on RAG console app (#500)#510
jongalloway merged 1 commit into
mainfrom
feature/500-part3-manual-rag

Conversation

@jongalloway

Copy link
Copy Markdown
Contributor

Summary

Adds the new Part 3: Add RAG by hand — extends the Part 2 console app with a complete, hand-written Retrieval-Augmented Generation loop and no vector database. Resolves #500.

Second hands-on part of the workshop rewrite.

What's included

  • Part 3 - Add RAG/RagChatApp/ — a net10.0 console project
    • IEmbeddingGenerator from the same AzureOpenAIClient (two abstractions, one resource)
    • Paragraph chunking of a sample document
    • Embed + store in an in-memory List (no vector DB)
    • Hand-written cosine similarity search + top-k retrieval
    • System-prompt augmentation with retrieved context, then the streaming chat loop from Part 2
    • Sample product doc (sample-docs/contoso-trailblazer-3000.md), copied to output
  • Part 3 - Add RAG/README.md — step-by-step walkthrough with a data-flow diagram

Teaching flow

Reinforces the swappable-abstraction theme: Part 2 swapped the chat provider, Part 3 shows the same idea for embeddings and vector stores. The in-memory store is deliberately naive to motivate the real vector store revealed in Part 4.

Models & provider

  • Provider: Azure AI Foundry (Azure OpenAI)
  • Chat: gpt-4.1-mini · Embeddings: text-embedding-3-small

Validation

Notes

Extends the Part 2 console app with a by-hand RAG loop on net10.0: IEmbeddingGenerator, paragraph chunking, in-memory vector store, hand-written cosine similarity search, top-k retrieval, and prompt augmentation. Includes a sample product doc and step-by-step README. Adapted from Steve Sanderson's dotnet-ai-workshop.
@jongalloway jongalloway merged commit ef23a1e into main Jul 3, 2026
1 of 2 checks passed
@jongalloway jongalloway deleted the feature/500-part3-manual-rag branch July 3, 2026 04:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Part 3 - Add RAG by hand (console: embeddings + in-memory vectors)

1 participant