Quickstart
uv add lexigram-ai-ragOptional extras for PDF loading, web scraping, reranking, and compression:
uv add "lexigram-ai-rag[pdf,web,compression,reranking]"Minimal Example
Section titled “Minimal Example”import asynciofrom lexigram import Applicationfrom lexigram.ai.rag import RAGModule
async def main() -> None: async with Application.boot( name="rag-demo", modules=[RAGModule.configure()], ) as app: pipeline = await app.container.resolve(RAGPipelineProtocol) result = await pipeline.execute( RAGContext(query="What is Lexigram?") ) if result.is_ok(): print(result.unwrap().answer)
asyncio.run(main())What Just Happened
Section titled “What Just Happened”RAGModule.configure()created aRAGProviderwith default config (in-memory backing,top_k=5, chunking enabled).- The provider registered
RAGPipelineProtocolandRetrievalStrategyProtocolin the container. pipeline.execute()ran retrieval → synthesis → quality assurance and returned aRAGResponse.
Next Steps
Section titled “Next Steps”- Guide — mental model, core concepts, common patterns
- Configuration — all config keys and env vars
- How-Tos — copy-pasteable recipes