Quickstart
Install
Section titled “Install”uv add lexigram-ai-workerslexigram-ai-workers depends on lexigram and lexigram-contracts (installed automatically).
Minimal Workers Setup
Section titled “Minimal Workers Setup”import asyncio
from lexigram import Application, LexigramConfigfrom lexigram.ai.workers import WorkersModule
async def main() -> None: config = LexigramConfig.from_yaml("application.yaml") app = Application(name="my-app", config=config) app.add_module(WorkersModule.configure()) await app.start()
print("Worker subsystem is running") await asyncio.sleep(10)
await app.stop()
asyncio.run(main())With application.yaml:
ai_workers: enabled: true batch_embedding_concurrency: 3 document_ingestion_concurrency: 3What Just Happened
Section titled “What Just Happened”WorkersModule.configure()creates aDynamicModulewith aWorkersProvider.Application.boot()starts the provider lifecycle:- register —
WorkersConfigand worker types are bound in the container. - boot — workers (
BatchEmbeddingWorker,DocumentIngestionWorker,MaintenanceWorker,DeadLetterQueueWorker) are resolved and started as background tasks.
- register —
Next Steps
Section titled “Next Steps”- Guide — mental model, worker types, typical workflows
- How-Tos — task-oriented recipes
- Configuration — all config keys and env-var overrides