Quickstart
Install
Section titled “Install”uv add lexigram-ai# Or with pippip install lexigram-ailexigram-ai depends on lexigram, lexigram-contracts, lexigram-ai-llm, lexigram-ai-rag, lexigram-ai-feedback, and lexigram-ai-observability.
Minimal wiring
Section titled “Minimal wiring”import asynciofrom lexigram import Applicationfrom lexigram.ai.module import AIModulefrom lexigram.ai.llm import ClientConfig
async def main() -> None: config = AIConfig( llm=ClientConfig( provider="openai", model="gpt-4o", api_key="sk-...", ), )
async with Application.boot( name="ai-demo", modules=[AIModule.configure(config)], ) as app: # LLMClientProtocol is now injectable from lexigram.contracts.ai import LLMClientProtocol
llm = await app.container.resolve(LLMClientProtocol) result = await llm.complete([{"role": "user", "content": "Say hello!"}])
if result.is_ok(): print(result.unwrap().content) else: print(f"Error: {result.unwrap_err()}")
asyncio.run(main())What you get
Section titled “What you get”AIModule.configure(config) registers the AIProvider which wires:
- LLM — multi-provider client (OpenAI, Anthropic, Ollama, Groq, Mistral, …)
- Vector — vector store backends (optional, requires
lexigram-vector) - RAG — retrieval-augmented generation pipelines (optional)
- Observability — AI tracing, metrics, and health monitoring
- Governance — audit logging and policy enforcement (optional)
Next steps
Section titled “Next steps”- Guide — mental model, core concepts, end-to-end workflows
- Architecture — provider composition and entry-point discovery
- Configuration — all config keys and env-var overrides
- Ecosystem — related AI packages