app/contains the FastAPI service, agent runtime (app/agent/), routing (app/routes*.py), streaming, monitoring, and configuration.db/holds database connection utilities, schema inspection, executors, and migrations.models/covers model loading, prompts, and inference helpers.tests/is split intotests/unit/andtests/integration/with shared fixtures intests/conftest.py.docs/,scripts/, anddeploy/provide design notes, automation, and deployment artifacts.
Use these from the repo root:
# Install dependencies (recommended)
bash scripts/install_with_constraints.sh
# Run the API locally
uvicorn app.main:app --reload
# Run tests
pytest
pytest --cov=app tests/
# Format, lint, type check
black app/ tests/
ruff check app/ tests/
mypy app/ db/ models/ --ignore-missing-imports
# Bring up local services
docker-compose up -d- Python 3.10+, formatted with Black and linted with Ruff (see
pyproject.toml). - Prefer explicit type hints for public functions and Pydantic models for request/response schemas.
- Naming:
snake_casefor modules/functions/vars,PascalCasefor classes, constants inUPPER_SNAKE_CASE.
- Pytest is the standard; use fixtures in
tests/conftest.pyfor shared setup. - Name tests
test_*.pyand functionstest_*; keep unit vs integration coverage in their folders. - For focused runs, use
pytest tests/unit/test_agent_engine.pyorpytest -k "validation".
- Follow conventional commits, e.g.
feat(agent): add retry tool,fix(api): handle empty schema,docs: update env vars. - PRs should link issues, include tests and docs where applicable, and stay focused to one change set.
- Ensure CI checks pass before requesting review.
- Configuration is driven by environment variables; start from
.env.exampleand document new settings inREADME.md. - Avoid hardcoding secrets; use runtime config for tokens and database credentials.