Admin Lambda
FastAPI-based admin service deployed as AWS Lambda. Provides administrative APIs for managing indexes, query configurations, sync jobs, monitoring, and forks.
Quick Reference
| Resource | Location |
|---|---|
| Source Code | components/admin_lambda/ |
| Infrastructure | infra/admin/ |
API Overview
All routes are prefixed with /api/v1.
| Route Prefix | Description |
|---|---|
/health |
Health check |
/accounts |
Account operations |
/admin/indexes |
Index listing and management |
/accounts/{id}/indexes/{name}/query-configs |
Query config CRUD |
/accounts/{id}/indexes/{name}/agentic-cached-queries |
Cached agentic queries |
/accounts/{id}/indexes/{name}/jobs |
Sync job monitoring |
/accounts/{id}/indexes/{name}/forks |
Index fork operations |
/accounts/{id}/indexes/{name}/export |
Index metadata export |
/accounts/{id}/indexes/{name}/import |
Index metadata import |
/admin/monitoring |
System health and metrics |
Guides
- Query Configs and
quote_mode - Export/Import API - Export and import index metadata
- Export/Import Schema - Response schemas
Local Development
cd components/admin_lambda
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
python run_local.py # http://localhost:8000
OpenAPI docs available at http://localhost:8000/docs.
Testing
pants test //components/admin_lambda::
Tests are integration tests that exercise routes through FastAPI's TestClient with moto-backed DynamoDB tables. Test files are colocated with routes (e.g., index_settings_routes_test.py).
Pattern: seed DynamoDB -> call endpoint -> assert response. See existing tests in routes/*_test.py for examples. Fixtures (auth_client, index_settings_table, api_key_content, etc.) are defined in admin_lambda/conftest.py.