zerda — RAG Strategies (types) Reference

On this page

What is this package?

Every subsystem in types follows the same shape: it wraps an already-constructed RAG backend (referred to throughout the source as rag_system, vector_db, or similar) and adds one specific capability — agentic reasoning loops, conversation memory, domain filtering, federation across multiple backends, knowledge-graph traversal, hybrid lexical+semantic search, multi-document isolation, multi-hop reasoning, self-critique/refinement, or token streaming. None of the ten modules import each other, so they can be adopted independently and composed by hand (e.g. wrap a DomainSpecificRAG inside a FederatedRAG source).

The ten subsystems

ModulePrimary classAdds
agentic_ragAgenticRAGIterative retrieve → refine → check-sufficiency → generate decision loop
conversational_ragConversationalRAGMulti-turn memory with JSON persistence
domain_ragDomainSpecificRAGQuery relevance gating against a named domain vocabulary
federated_ragFederatedRAGParallel querying of multiple RAG backends with aggregation, caching, circuit-breaking, streaming
graph_ragGraphRAG, KnowledgeGraphEntity/relation graph storage and BFS context expansion around a vector DB
hybrid_searchHybridSearchRAGBM25/TF-IDF keyword search fused with semantic search
multi_doc_ragMultiDocumentRAGSystemIndependent per-document chunking, filtering, and management
multi_hopMultiHopRAGMulti-step reasoning with gap analysis between hops
self_improving_ragSelfIRAG, HyDERAG, RecursiveRAGSelf-evaluation/refinement, hypothetical-document embeddings, and question decomposition
streaming_ragStreamingRAGToken-level async/sync streaming with typed lifecycle events

How to read this documentation

  • Quickstart — the minimal object graph needed to instantiate any subsystem.
  • Architecture — the shared design pattern across all ten modules, with diagrams.
  • API Reference — one deep-dive page per subsystem with every public class, method, exception, and config field, sourced directly from the code.
  • FAQ / Troubleshooting — answers derived from observed error-handling and fallback code paths.

[!WARNING] External dependencies are not verifiable Classes such as the base RAGSystem, VectorDatabase, DocumentChunk, chunkers, and LLM clients are referenced by this package but not defined in it. This documentation describes the contract each module expects from those objects (e.g. "must expose .retrieve(query) and .generate(prompt)") without asserting how they are implemented.

Related pages