By the end of this guide you will have a fully functional local copy of the Innova AI Engine running against shared infrastructure, passing lint and type checks, and executing the full test suite — without touching any cloud resources. The engine powers knowledge tracing (BKT/IRT), LLM error classification, document AI, and OCR for the SuperProfe platform, so your local environment mirrors exactly what runs on AWS Lambda in production.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/vruizz22/innova-ai-engine/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Before you begin, make sure you have the following installed and available:- Python 3.11 — the version is pinned in
.python-version; other versions are not supported uvpackage manager — see the uv installation docs (curl -LsSf https://astral.sh/uv/install.sh | sh)- Docker — required to run the shared Postgres, MongoDB, and LocalStack services via the backend’s
docker-compose - Anthropic and Gemini API keys — only needed if you intend to call those providers directly; the test suite mocks them
Setup
Clone the repo and install dependencies
Clone the repository and let
uv bootstrap the virtual environment and install all packages including dev extras:uv sync --all-extras creates a .venv automatically, pins everything to the resolved uv.lock, and installs dev dependencies (pytest, hypothesis, moto, ruff, pyright, and friends).Copy and configure the environment file
.env and fill in at minimum:| Variable | Why it’s required |
|---|---|
ANTHROPIC_API_KEY | Any worker that calls Claude will fail without it (can be a dummy for pure math tests) |
GEMINI_API_KEY | Required by OCR and guide-ingest workers |
DATABASE_URL | Points to the local Postgres instance started in the next step |
MONGODB_URI | Points to the local MongoDB instance started in the next step |
.env.example ships with sane defaults for the local Docker ports — DATABASE_URL defaults to postgresql://postgres:innova_secret@localhost:5433/innova_dev_db and MONGODB_URI to mongodb://root:innova_mongo_secret@localhost:27017/innova_ai_engine_local?authSource=admin.All other variables (SQS ARNs, S3 buckets, SSM parameters, tuning knobs) have defaults in
.env.example and are only strictly needed when exercising the full pipeline end-to-end against LocalStack or real AWS.Start shared infrastructure
The engine shares Postgres, MongoDB, and LocalStack with This exposes Postgres on port 5433, MongoDB on port 27017, and LocalStack on port 4566. Wait for all containers to be healthy before proceeding.
innova-backend-serverless. Start those services from the backend repo:Run lint
E, F, I, N, UP, B, RUF, and T201 at line length 100. Zero issues are required before a PR can merge.Run type check
typeCheckingMode = "strict") targeting Python 3.11. It covers the src/ tree only (tests are excluded). Zero errors are required.Run the test suite
Running a worker locally
Lambda handlers are plain Python functions with the signaturehandler(event, context). You can invoke any handler directly from the command line without a local Lambda runtime.
Cron workers (no SQS event needed)
The nightly calibration workers accept an empty event dict:SQS workers
SQS-triggered workers expect a minimal Lambda SQS event envelope. Below is an example for thellmClassifier, which processes batches of up to 20 unclassified attempts: