Add CommunityToolkit.DataIngestion package with LLM chunk processors#10
Closed
luisquintanilla wants to merge 8 commits into
Closed
Add CommunityToolkit.DataIngestion package with LLM chunk processors#10luisquintanilla wants to merge 8 commits into
luisquintanilla wants to merge 8 commits into
Conversation
… DataIngestion) Port intelligent PDF ingestion packages from luisquintanilla/PdfPig (feature/intelligent-pdf-ingestion branch, PRs #1 and #2) into the AI Community Toolkit as a new MEDI top-level feature area. New packages: - CommunityToolkit.DocumentProcessing.PdfPig.OnnxLayoutAnalysis ONNX-based layout detection (RT-DETR, configurable models, image preprocessing, NMS) implementing PdfPig IPageSegmenter - CommunityToolkit.DocumentProcessing.PdfPig.DataIngestion MEDI bridge with vision LLM enrichers (OCR, table extraction, contextual chunking) for PDF document ingestion Infrastructure: - MEDI/ directory structure following MEVD pattern - Directory.Build.props for src and test - Central package management updates - MEDI.slnf solution filter - medi.yml CI workflow - nuget.config with source mapping for dotnet-public feed Test results: 216 total (213 passed, 3 skipped for missing ONNX model) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Port retrieval processors from MEDIExtensions to CommunityToolkit: - DataRetrieval: MultiQueryExpander, HydeQueryTransformer, AdaptiveRouter, CragValidator, LlmReranker, TreeSearchRetriever, SelfRagOrchestrator, SpeculativeRagOrchestrator, RetrievalPipelineBuilder, DI extensions - DataRetrieval.OnnxReranker: CrossEncoderReranker with ONNX inference, TextPairTokenizer, TokenizerFactory (BERT/BPE/SentencePiece support) Both packages target net10.0;net8.0, build with 0 errors/0 warnings. Added local NuGet source for Microsoft.Extensions.DataRetrieval packages. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds a terminal method to RetrievalPipelineBuilder that registers
a VectorStoreRetriever<TKey,TRecord> as IRetriever in DI. This
enables the builder pattern: services.AddRetrievalPipeline(b => {
b.AddQueryProcessor(...); }).AsRetriever<K,R>(...);
Also exposes Services property on builder so the terminal can
register the retriever in the service collection.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Port 4 LLM-powered ingestion chunk processors from MEDIExtensions: - EntityExtractionProcessor: NER via LLM (people, orgs, tech, versions) - TopicClassificationProcessor: Configurable taxonomy classification - HypotheticalQueryProcessor: Reverse HyDE question generation - TreeIndexProcessor: RAPTOR-style tree index (leaf/branch/root summaries) Includes: - IngestionPipelineBuilder<T> with fluent builder extensions - DataIngestionServiceCollectionExtensions for DI registration - MetadataKeys constants (FDG compliance) - Optional ILogger on all processors (FDG compliance) - JsonDefaults internal utility Implements IngestionChunkProcessor<string> from the stable Microsoft.Extensions.DataIngestion package. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Port retrieval processor unit tests from MEDIExtensions with namespace remapping. Covers: MultiQueryExpander, LlmReranker, HydeQueryTransformer, CragValidator, AdaptiveRouter, SelfRagOrchestrator, SpeculativeRagOrchestrator, TreeSearchRetriever. Includes test utilities (TestChatClient, TestVectorStoreCollection) for deterministic LLM-free testing. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Port ingestion processor unit tests covering: EntityExtraction, TopicClassification, HypotheticalQuery, TreeIndex processors. All tests use TestChatClient for deterministic LLM-free execution. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This was referenced Jul 1, 2026
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.
PR: Add CommunityToolkit.DataIngestion — LLM Chunk Enrichment Processors
Description
Adds a new
CommunityToolkit.DataIngestionpackage providing 4 LLM-powered chunk processors forMicrosoft.Extensions.DataIngestionpipelines. These processors run at ingestion time to enrich chunks with semantic metadata, dramatically improving downstream retrieval quality without adding latency to the query path.What Each Processor Does
EntityExtractionProcessorTopicClassificationProcessorHypotheticalQueryProcessorTreeIndexProcessorMetadata Written
entities_people,entities_organizations,entities_technologies,entities_versions"Microsoft, .NET Foundation"topic_primary,topic_secondary"security","data,web"chunk_type,parent_chunk_id,hypothetical_questions"hypothetical_query","12345"level,chunk_type,parent_id1,"branch_summary","root"Also includes:
IngestionPipelineBuilder<T>— fluent builder with convenience methodsDataIngestionServiceCollectionExtensions— DI registrationMetadataKeys— strongly-typed metadata key constantsUsage
Design Notes
Relationship to
ProcessAsyncin DataIngestion:ProcessAsyncpattern asMicrosoft.Extensions.DataIngestion.IngestionPipeline.ProcessAsyncRetrieveAsync(distinct vocabulary for read vs. write paths)FDG Improvements over original MEDIExtensions source:
public const stringfields inMetadataKeysclassILogger<T>on all processors (was: silent exception swallowing)JsonDefaultsper package (clean boundary)Dependencies
All stable, shipped packages:
Microsoft.Extensions.DataIngestionMicrosoft.Extensions.AI.AbstractionsMicrosoft.Extensions.DependencyInjection.AbstractionsMicrosoft.Extensions.Logging.AbstractionsChecklist
Related
Microsoft.Extensions.DataIngestion(stable, no design review needed)