Event-driven telemetry platform for Amplifier sessions. Captures session events as structured data and builds a property graph in Neo4j.
Amplifier CLI → hook (POST /events) → Ingestion Server (:8000) → Neo4j graph + blob storage
See README.md for full setup instructions.
context_intelligence_server/ # FastAPI ingestion server
├── main.py # App factory, routes, lifespan
├── config.py # Settings (YAML + env vars via Pydantic)
├── pipeline.py # Event dispatch pipeline
├── neo4j_store.py # Buffered Neo4j writes
├── blob_store.py # Async disk blob storage
├── handlers/ # Event handlers (data_layer_1/2/3)
│ ├── data_layer_1/ # Session/tool-call handlers
│ ├── data_layer_2/ # Graph enrichment handlers
│ └── data_layer_3/ # High-level insight handlers
├── auth.py # API key authentication
├── dashboard.py # Dashboard SSE stream
├── models.py # Pydantic request/response models
└── web/ # Dashboard HTML + static assets
docs/
├── architecture/ # DOT diagrams: pipeline, handlers, graph model
└── service-setup.md # Running as a system service
tests/
├── handlers/ # Handler unit tests
├── integration/ # Pipeline integration tests
└── neo4j/ # Tests requiring a live Neo4j instance
Requires Python 3.11+ and uv.
uv sync
uv run pytest tests/ -q # All tests (no Neo4j required)
uv run pytest tests/neo4j/ -q # Neo4j tests (requires running instance)Most tests run against in-memory fakes. The tests/neo4j/ suite requires a live Neo4j 5.x instance — see tests/neo4j/conftest.py for connection details.
# 1. Start Neo4j (Docker, easiest)
docker run -d --name neo4j-ci \
-p 7474:7474 -p 7687:7687 \
-e NEO4J_AUTH=none \
neo4j:5.26.22-community
# 2. Configure and start the server
cp server-config.example.yaml server-config.yaml
# Edit server-config.yaml with your Neo4j connection details
# 3. Start
uvicorn context_intelligence_server.main:app --reloadOr use Docker Compose to run everything together:
./start.sh- Event pipeline —
POST /eventsqueues work; handlers process events asynchronously. Each handler is a Python class inhandlers/data_layer_*/. - Graph model — 5 node types, 8 edge types. See
docs/architecture/03-graph-model.dotfor the diagram anddocs/architecture/README.mdfor the legend. - Blob storage — Large event payloads are written to disk and referenced by URI to avoid graph bloat.
- Configuration — Pydantic Settings reads from
server-config.yamlfirst, then environment variables. Seeconfig.py.
- New handler: Add a class to the appropriate
handlers/data_layer_*/directory, register it inhandlers/__init__.py. - New API endpoint: Add a route to
main.pyor a new router underrouters/. - Configuration: Add fields to
ServerConfiginconfig.py. Keep defaults conservative. - Tests: Every handler should have a unit test in
tests/handlers/. Integration tests live intests/integration/.
Run uv run pytest tests/ -q to verify before committing.