Installation
Requirements
Section titled “Requirements”- Python 3.11 or higher
- uv (recommended) or pip
Quick Install
Section titled “Quick Install”# uv (recommended — fast, deterministic)uv add lexigram
# pippip install lexigramThe core lexigram package gives you:
| Feature | Import | Description |
|---|---|---|
Application | from lexigram import Application | Composition root with lifecycle management |
Provider | from lexigram import Provider | Two-phase register / boot service wiring |
Container | from lexigram import Container | IoC container — singleton, scoped, transient bindings |
| DI decorators | from lexigram import singleton, injectable, scoped, transient | Mark classes for auto-registration |
LexigramConfig | from lexigram import LexigramConfig | YAML + env vars + profile overlays |
Result | from lexigram.result import Result, Ok, Err | Explicit error handling with unwrap, map, and_then |
module | from lexigram import module, Module | @module decorator with import/export boundaries |
lexigram-contracts (the zero-dependency protocol layer, imported as lexigram.contracts.*) is installed automatically as a dependency of lexigram.
Common Stacks
Section titled “Common Stacks”Install only what you need. Every extension depends only on lexigram (core) and lexigram-contracts — never on each other.
Web API
Section titled “Web API”uv add lexigram-webASGI web layer — controllers, routing, middleware, OpenAPI docs, CORS, CSRF, rate limiting.
Database
Section titled “Database”uv add lexigram-sqlAsync SQL for Postgres / MySQL / SQLite — repositories, migrations, query building.
uv add lexigram-ai lexigram-ai-llmMulti-provider LLM client and the orchestration layer. Add lexigram-ai-rag, lexigram-ai-agents, and lexigram-vector as needed.
All Packages
Section titled “All Packages”The open-source ecosystem is 35+ extensions across these areas. See The Ecosystem for the full, annotated list.
| Category | Packages |
|---|---|
| Foundation | lexigram, lexigram-contracts |
| Web & API | lexigram-web, lexigram-http, lexigram-graphql |
| Data & Persistence | lexigram-sql, lexigram-nosql, lexigram-cache, lexigram-storage, lexigram-search, lexigram-vector, lexigram-graph |
| AI | lexigram-ai, lexigram-ai-llm, lexigram-ai-rag, lexigram-ai-agents, lexigram-ai-memory, lexigram-ai-skills, lexigram-ai-session, lexigram-ai-mcp, lexigram-ai-workers, lexigram-ai-feedback |
| Messaging & Workflow | lexigram-events, lexigram-queue, lexigram-notification, lexigram-webhook, lexigram-workflow |
| Background Work | lexigram-tasks |
| Observability & Reliability | lexigram-monitor, lexigram-resilience, lexigram-audit, lexigram-ai-observability |
| Security & Multi-Tenancy | lexigram-auth, lexigram-tenancy, lexigram-features |
| Developer Tooling | lexigram-cli, lexigram-testing |
Developer Tools
Section titled “Developer Tools”# CLI — project scaffolding, dev server, migrationsuv add lexigram-cli
# Testing — fakes, test clients, compliance suitesuv add --dev lexigram-testingWith lexigram-cli installed you get the lexigram command:
lexigram new my-app # scaffold a projectlexigram run # auto-detect create_app() and servelexigram db upgrade # run migrationsVerify Installation
Section titled “Verify Installation”python -c "import lexigram; print(lexigram.__version__)"Next Steps
Section titled “Next Steps”- Your First App — Build a working API
- Project Structure — Recommended layouts
- Core Concepts — Providers, DI, Result type, and modules
- The Ecosystem — Every package, grouped by purpose