feat: add GenAI building-block samples (DataIngestion, MCP, A2A, MAF image-gen) + fixes#521
Open
elbruno wants to merge 1 commit into
Open
feat: add GenAI building-block samples (DataIngestion, MCP, A2A, MAF image-gen) + fixes#521elbruno wants to merge 1 commit into
elbruno wants to merge 1 commit into
Conversation
…MCP-01, MAF-ImageGen) and fixes New samples: - CoreSamples/DataIngestion-01-Simple: document ingestion pipeline with sqlite-vec - CoreSamples/MCP-03-MicrosoftLearn: before/after grounding with Microsoft Learn MCP - MAF/A2A-01: Agent-to-Agent protocol host + client - MAF/MAF-MCP-01: MAF agent owning Learn MCP tools - MAF/MAF-ImageGen-03-Foundry: MAF agent with GPT-Image-2 image tool Updates/fixes: - BasicChat-05AIFoundryModels: Foundry model swap + Entra ID integrated security - RAGSimple-02MEAIVectorsMemory: sqlite-vec store, multi-query, streaming - MAF01/MAF02: token-by-token streaming output - Lesson 03/04 docs: updated sample tables and descriptions
|
👋 Thanks for contributing @elbruno! We will review the pull request and get back to you soon. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR expands the course’s runnable .NET building-block content by adding new CoreSamples and MAF samples (Data Ingestion, MCP grounding, Agent-to-Agent, MAF-owned MCP tools, and Foundry image generation), while also updating a few existing demos and lesson docs to align with the new sample set.
Changes:
- Added new samples:
DataIngestion-01-Simple,MCP-03-MicrosoftLearn,MAF-MCP-01,A2A-01, andMAF-ImageGen-03-Foundry, and registered them in the relevant solutions. - Updated existing MAF demos (
MAF01,MAF02) to stream agent/workflow output token-by-token for better live demos. - Refreshed Lesson 03/04 documentation tables and descriptions to reference the new/updated samples.
Show a summary per file
| File | Description |
|---|---|
| samples/MAF/MAF02/Program.cs | Switches workflow output to streaming in console. |
| samples/MAF/MAF01/Program.cs | Switches agent output to streaming in console. |
| samples/MAF/MAF-MCP-01/README.md | Documents a MAF agent that owns Microsoft Learn MCP tools. |
| samples/MAF/MAF-MCP-01/Program.cs | Implements MAF agent wiring to Microsoft Learn MCP tools + streaming output. |
| samples/MAF/MAF-MCP-01/MAF-MCP-01.csproj | Adds new MAF MCP sample project and dependencies. |
| samples/MAF/MAF-ImageGen-03-Foundry/README.md | Documents Foundry GPT-Image-2 tool wrapped for a MAF agent. |
| samples/MAF/MAF-ImageGen-03-Foundry/Program.cs | Implements image-gen tool + MAF agent composition and saving/opening output PNGs. |
| samples/MAF/MAF-ImageGen-03-Foundry/MAF-ImageGen-03-Foundry.csproj | Adds new image-gen sample project and dependencies. |
| samples/MAF/MAF-Demos.slnx | Registers new MAF samples in the MAF demo solution. |
| samples/MAF/A2A-01/README.md | Documents the minimal in-process A2A server+client demo. |
| samples/MAF/A2A-01/Program.cs | Implements hosting a MAF agent over A2A and calling it via A2AClient. |
| samples/MAF/A2A-01/A2A-01.csproj | Adds new A2A sample project and preview dependencies. |
| samples/CoreSamples/RAGSimple-02MEAIVectorsMemory/README.md | Updates docs to reflect sqlite-vec + VectorData abstractions and keyless auth. |
| samples/CoreSamples/RAGSimple-02MEAIVectorsMemory/RAGSimple-02MEAIVectorsMemory.csproj | Moves sample to sqlite-vec connector + Azure.Identity + newer MEAI packages. |
| samples/CoreSamples/RAGSimple-02MEAIVectorsMemory/Program.cs | Reworks RAG sample to VectorData + sqlite-vec and multiple queries. |
| samples/CoreSamples/MCP-03-MicrosoftLearn/README.md | Documents the “before/after grounding” MCP demo using Microsoft Learn MCP server. |
| samples/CoreSamples/MCP-03-MicrosoftLearn/Program.cs | Implements grounded vs ungrounded comparison using MCP tools + function invocation. |
| samples/CoreSamples/MCP-03-MicrosoftLearn/MCP-03-MicrosoftLearn.csproj | Adds the MCP-03 sample project and dependencies. |
| samples/CoreSamples/DataIngestion-01-Simple/README.md | Documents ingestion pipeline stages and how to run the sample. |
| samples/CoreSamples/DataIngestion-01-Simple/Program.cs | Implements ingestion pipeline (read/chunk/enrich/embed/write) + search over sqlite-vec. |
| samples/CoreSamples/DataIngestion-01-Simple/DataIngestion-01-Simple.csproj | Adds the ingestion sample project, packages, and data copy rules. |
| samples/CoreSamples/DataIngestion-01-Simple/data/dotnet-ai-building-blocks.md | Adds ingestion input content describing .NET AI building blocks. |
| samples/CoreSamples/CoreGenerativeAITechniques.sln | Registers new CoreSamples projects (MCP-03, DataIngestion-01). |
| samples/CoreSamples/BasicChat-05AIFoundryModels/README.md | Adds documentation for Foundry model swap + integrated security flow. |
| samples/CoreSamples/BasicChat-05AIFoundryModels/app.cs | Updates Foundry chat demo to support auth mode + one-shot question. |
| 04-AgentsWithMAF/04-model-context-protocol.md | Updates Lesson 04 sample table to include MCP-03 and MAF-MCP-01. |
| 04-AgentsWithMAF/03-multi-agent-workflows.md | Updates Lesson 04 workflow table to include A2A-01. |
| 04-AgentsWithMAF/02-agents-with-tools.md | Updates Lesson 04 tools table to include MAF-ImageGen-03-Foundry. |
| 03-AIPatternsAndApplications/readme.md | Updates Lesson 03 sample references (sqlite-vec update). |
| 03-AIPatternsAndApplications/02-retrieval-augmented-generation.md | Adds DataIngestion-01-Simple + updates RAGSimple-02 description. |
| 03-AIPatternsAndApplications/01-embeddings-semantic-search.md | Updates wording + sample references for sqlite-vec update. |
Copilot's findings
- Files reviewed: 31/31 changed files
- Comments generated: 3
Comment on lines
+20
to
+25
| // Swap the model by changing ONLY the deployment name. | ||
| // In Microsoft Foundry you deploy several models behind the same endpoint, e.g.: | ||
| // gpt-5.5 -> grok-4.3 -> phi-4 -> ... (same code, same endpoint, just this string). | ||
| //var deploymentName = config["AzureOpenAI:Deployment"] ?? "gpt-5-mini"; | ||
| var deploymentName = "Kimi-K2.6"; | ||
|
|
Comment on lines
+33
to
+56
| var chatModel = config["AzureOpenAI:ChatDeployment"] ?? "gpt-5-mini"; | ||
| var embeddingModel = config["AzureOpenAI:EmbeddingDeployment"] ?? "text-embedding-3-small"; | ||
|
|
||
| using ILoggerFactory loggerFactory = | ||
| LoggerFactory.Create(builder => builder.AddSimpleConsole()); | ||
|
|
||
| // Create the Azure OpenAI clients (keyless: uses your `az login` credentials). | ||
| var azureClient = new AzureOpenAIClient(new Uri(endpoint), new AzureCliCredential()); | ||
| IChatClient chatClient = azureClient.GetChatClient(chatModel).AsIChatClient(); | ||
| IEmbeddingGenerator<string, Embedding<float>> embeddingGenerator = | ||
| azureClient.GetEmbeddingClient(embeddingModel).AsIEmbeddingGenerator(); | ||
|
|
||
| // --- READ ------------------------------------------------------------------ | ||
| // Read Markdown documents into a unified, LLM-friendly representation. | ||
| IngestionDocumentReader reader = new MarkdownReader(); | ||
|
|
||
| // --- CHUNK ----------------------------------------------------------------- | ||
| // Split documents into semantic chunks so related content stays together. | ||
| IngestionChunkerOptions chunkerOptions = new(TiktokenTokenizer.CreateForModel(chatModel)) | ||
| { | ||
| MaxTokensPerChunk = 2000, | ||
| OverlapTokens = 0 | ||
| }; | ||
| IngestionChunker<string> chunker = new SemanticSimilarityChunker(embeddingGenerator, chunkerOptions); |
Comment on lines
+36
to
+38
| After ingestion, type a question and the app returns the most relevant chunks with | ||
| their similarity scores. The vector data is persisted to a local `buildingblocks-vectors.db` | ||
| sqlite-vec file next to the app binary. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds several new building-block samples and applies fixes/enhancements to existing samples and lesson docs. All new samples are generic and reusable for the course (no event/session-specific content).
New samples
CoreSamples/DataIngestion-01-SimpleCoreSamples/MCP-03-MicrosoftLearnMAF/A2A-01MAF/MAF-MCP-01MAF/MAF-ImageGen-03-FoundryFixes & enhancements
Validation
dotnet build samples/CoreSamples/CoreGenerativeAITechniques.sln -c Release→ Build succeeded, 0 errors.dotnet build samples/MAF/MAF-Demos.slnx -c Release→ Build succeeded, 0 errors.New projects are registered in their respective solutions (
CoreGenerativeAITechniques.sln,MAF-Demos.slnx).