Last updated: 2026-05-08.
AI Engine — RAG, local LLM inference and structured educational game generation.
ai-engine provides the shared AI runtime capability for AxiomNode: retrieval-augmented generation, structured educational game generation, local or split llama execution, and observability of AI activity.
It owns AI-specific generation, ingest, cache-aware behavior, and model-target selection. It does not own the domain validity or persistence rules enforced later by quiz and word-pass services.
Current platform status: ai-engine-api and ai-engine-stats can be deployed in-cluster for staging while the llama runtime remains external or workstation-hosted. Runtime target state is visible through Backoffice diagnostics and may differ from static environment defaults.
Full documentation is available in the docs/ folder:
| Guide | Description |
|---|---|
| Architecture Index | Context, system design, technologies, ADRs, and repository layout |
| Distributions Matrix | Stage/environment deployment matrix (dev/stg/pro x windows/windows-gpu/vps-cpu/vps-gpu) |
| Guides Index | Getting started, RAG, KBD, SDK, and metrics usage guides |
| Operations Index | Deployment, incident runbook, and continuous improvement logs |
docs/README.mddocs/architecture/README.mddocs/guides/README.mddocs/operations/README.mdsrc/distributions/README.md
ai-engine is both a Python library surface and a deployable runtime split into API, stats, and llama-serving concerns.
ai-engine runs as an internal AI capability service for domain microservices.
- It is not intended as a public endpoint for end users.
- Expected consumers:
microservice-quizz,microservice-wordpass, and other authorized internal services. - Recommended exposure: private network with service-to-service access controls.
Initial internal contract:
contracts-and-schemas/schemas/openapi/internal-ai-engine.v1.yaml
The repository produces multiple runtime components that can be deployed together or in a split topology:
ai-engine-api: generation and ingest surfaceai-engine-stats: AI observability and cache/statistics surfacellama-server: model-serving runtime used byai-engine-api- Redis cache backend in local or split-runtime environments
ai-engine-api: primary AI generation and ingestion API, with cache and RAG integration.ai-engine-stats: AI observability API for events and aggregated runtime metrics.llama-server: local LLM inference runtime used by the engine.
Detailed runtime topology, module boundaries, and distribution rules live under docs/architecture/README.md, docs/operations/README.md, and src/distributions/README.md.
ai-engine-api can persist runtime model-target information so that the active llama destination survives process restart or pod recreation. Effective model routing can therefore differ from environment defaults during controlled operations.
cd src
pip install -e ".[dev]"cd src
pip install -e ".[llm]"cd src
pip install -e ".[games]"cd src
pip install -e ".[api]"The recommended model is Phi-3.5-mini-instruct (Q4_K_M, ~2.4 GB), excellent for structured JSON generation:
python -m ai_engine.llm.model_manager downloadTo list all available models:
python -m ai_engine.llm.model_manager listcd src
pytestFor module layout, usage guides, and distribution-specific install flows, use the local documentation indexes instead of duplicating that detail here.
Core dependencies vary by runtime slice:
ai-engine-api: llama runtime, embeddings/model assets, cache backend, stats APIai-engine-stats: internal collector state and optional bridge to API runtime informationllama-server: GGUF models and machine-level CPU/GPU resources
Primary consumers:
microservice-quizzmicroservice-wordpassbff-backofficediagnostics and stats flowsapi-gatewayinternal AI proxy routes
- CI, distribution-specific rollout, and incident recovery are documented in
docs/operations/README.md. - The split runtime model and deployment matrix are documented in
src/distributions/README.md. - Cross-repo behavior is documented in
../docs/guides/capabilities/ai/ai-content-generation.mdand../docs/guides/capabilities/ai/ai-observability-and-diagnostics.md.
docs/guides/README.mdfor usage guides.docs/operations/README.mdfor deployment and recovery.docs/architecture/README.mdfor module boundaries and ADRs.src/distributions/README.mdfor the deployment matrix.../docs/guides/capabilities/ai/ai-content-generation.mdfor the cross-repo capability view.