Draft
Conversation
- Add NuGet packages: Microsoft.Extensions.VectorData.Redis, UglyToad.PdfPig - Create RagConfig, DocumentChunk, DocumentInfo, DocumentSearchResult models - Create IDocumentVectorStore and IDocumentIngestionService abstractions - Create RedisDocumentVectorStore (Redis vector search implementation) - Create PdfDocumentIngestionService (PDF extraction, chunking, embedding) - Create RagMcpQueryService with MCP tools (search, list, ingest, remove) - Create RagIngestionBgService for auto-ingestion on startup - Create EmbeddingGeneratorFactory for Ollama/OpenAI/AzureOpenAI - Add FeatureNames.Rag constant and wire up in Program.cs - Update docker-compose to use redis/redis-stack-server image - Add nomic-embed-text embedding model pull to ollama-init - Add EdgeEmbedding provider and RagConfig to appsettings - Update HeatingAgent and AppliancesAgent instructions with RAG guidance Agent-Logs-Url: https://github.com/f2calv/SmartHaus/sessions/7df8a854-c8fb-4d26-81aa-074fe0d0135c Co-authored-by: f2calv <16097639+f2calv@users.noreply.github.com>
…ctory - Use PdfPig 0.1.14 (correct version on NuGet) - Remove Microsoft.Extensions.VectorData.Redis (not available on NuGet) - Implement Redis vector search using raw FT.CREATE/FT.SEARCH commands - Fix RagIngestionBgService to use IBgFeature.ExecuteAsync pattern - Fix OllamaApiClient embedding (directly implements IEmbeddingGenerator) - Use System.ClientModel.ApiKeyCredential for OpenAI client Agent-Logs-Url: https://github.com/f2calv/SmartHaus/sessions/7df8a854-c8fb-4d26-81aa-074fe0d0135c Co-authored-by: f2calv <16097639+f2calv@users.noreply.github.com>
- Extract Server property with null-safe FirstOrDefault in RedisDocumentVectorStore - Extract CharsPerTokenApprox constant in PdfDocumentIngestionService - Add ArgumentException guard for overlap >= chunk size (prevents infinite loop) - Rename Create to CreateEmbeddingGenerator in EmbeddingGeneratorFactory Agent-Logs-Url: https://github.com/f2calv/SmartHaus/sessions/7df8a854-c8fb-4d26-81aa-074fe0d0135c Co-authored-by: f2calv <16097639+f2calv@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
f2calv
April 26, 2026 04:18
View session
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.
Adds infrastructure for ingesting PDF documents into Redis vector indexes and surfacing retrieved context to agents via MCP tools. Agents like HeatingAgent and AppliancesAgent can now search ingested manuals (heatpump setup guides, Miele appliance PDFs) for relevant context when answering questions.
Vector store (raw Redis Search)
Microsoft.Extensions.VectorData.Redisdoesn't exist on NuGet yet, so the implementation usesFT.CREATE/FT.SEARCHcommands directly viaStackExchange.Redis. HNSW indexing with configurable distance metric (default: cosine).PDF ingestion pipeline
PdfDocumentIngestionService: PdfPig extraction → token-approximate chunking (configurable size/overlap) → batch embedding viaIEmbeddingGenerator<string, Embedding<float>>→ upsert to Redis.Embedding generator factory
EmbeddingGeneratorFactory— mirrors the existingAgentExtensions.CreateAgentpattern forIChatClient. Supports Ollama (OllamaApiClient directly implementsIEmbeddingGenerator), OpenAI, and AzureOpenAI. Local helper untilCasCap.Common.AIadds a shared version.MCP tools (
RagMcpQueryService)SearchDocuments— KNN vector similarity searchListDocuments/GetDocumentInfo— collection metadataIngestDocument/RemoveDocument— on-demand managementInfrastructure
redis→redis/redis-stack-server(enables Search module);ollama-initpullsnomic-embed-text(768d)RagIngestionBgService: auto-ingests PDFs from configured directory on startupFeatureNames.Rag— opt-in, zero impact on existing featuresConfiguration
Notes for follow-up
EmbeddingGeneratorFactoryshould migrate toCasCap.Common.AIas a sharedAgentExtensions.CreateEmbeddingGeneratorIChatClientdecorator that auto-injects retrieved chunks into agent prompts) is a natural next stepMicrosoft.Extensions.VectorData.Redisships on NuGet,RedisDocumentVectorStorecan be simplified to use the official abstraction