agentic_rag 0.1.1
agentic_rag: ^0.1.1 copied to clipboard
Retrieval-augmented generation for Dart: loading, chunking, dense and BM25 retrieval, rank fusion, re-ranking, cited answers and retrieval tools.
Changelog #
0.1.1 #
- Tightened the package description. This one already scored full marks; the change keeps the wording consistent with its sibling packages, which did not.
0.1.0 #
Initial release of the retrieval layer.
Added #
- Values —
RagDocument,DocumentChunk,RetrievedChunkandCitation. Kept separate so an answer can always say which document, and which part of it, a claim came from. Documents carry a stable content fingerprint. - Chunking —
Chunkerport withBaseChunkersupplying the identifier convention and metadata propagation;RecursiveChunkersplitting at the strongest boundary that fits,MarkdownChunkersplitting at headings and putting the heading path into the chunk text so heading terms stay searchable, andFixedSizeChunkeras an honest baseline. - Loading —
DocumentLoaderport withTextDocumentLoader,MarkdownDocumentLoader(YAML front matter to metadata, first heading to title),HtmlDocumentLoader(dependency-free text extraction and entity decoding) andCompositeDocumentLoader. Nothing touchesdart:io, so the package runs on the web. - Ingestion —
RagIndexer, which chunks, embeds and writes; skips unchanged documents by fingerprint; deletes the stale tail a shortened document leaves behind; keeps a keyword index in step; and records one failure without abandoning the run. - Retrieval —
Retrieverport;VectorRetrieverover anEmbeddingIndex;KeywordRetrieverwith a real BM25InMemoryKeywordIndex;HybridRetrieverfusing rankings with reciprocal rank fusion, optionally weighted; andNeighbourExpandingRetrieverfor adjacent-chunk context. - Re-ranking —
Rerankerport;ScoreFloorReranker,MmrRerankerfor diversity (refusing to run without vectors rather than degrading silently),LlmRerankerwhich falls back to the retriever's ordering on failure, andChainedRerankerfor cheap-before-expensive ordering. - Pipeline —
RagPipelineassembling numbered passages within a character budget, generating a cited answer, and resolving markers back to documents;RagContextreporting what it dropped andRagAnswerreporting whether the answer was grounded at all. - Tools —
searchToolso an agent decides when to search, andansweringToolfor a corpus that deserves its own specialist. - Events —
DocumentsIndexed,ChunksRetrieved(carrying the identifiers that make an answer reproducible),ChunksReranked(carrying how many passages the step actually promoted) andAnswerGenerated(offered against used, the over-fetching signal).