Skip to main content

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

ResourceLocation
Source Codecomponents/admin_lambda/
Infrastructureinfra/admin/

API Overview

All routes are prefixed with /api/v1.

Route PrefixDescription
/healthHealth check
/accountsAccount operations
/admin/indexesIndex listing and management
/accounts/{id}/indexes/{name}/query-configsQuery config CRUD
/accounts/{id}/indexes/{name}/agentic-cached-queriesCached agentic queries
/accounts/{id}/indexes/{name}/jobsSync job monitoring
/accounts/{id}/indexes/{name}/forksIndex fork operations
/accounts/{id}/indexes/{name}/exportIndex metadata export
/accounts/{id}/indexes/{name}/importIndex metadata import
/admin/monitoringSystem health and metrics

Guides

Local Development

cd components/admin_lambda
python -m venv .venv && source .venv/bin/activate
pip install -r ../../../3rdparty/python/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.