Overview
The FastAPI server (graphiti/server) implements the core Graphiti operations as REST endpoints, making it easy to integrate Graphiti into web applications, microservices, and non-Python environments.
Docker Image: zepai/graphiti
Available tags:
latest- Latest stable release0.22.1- Specific version (matches graphiti-core version)
Quick Start
Using Docker Compose
The fastest way to get started is with Docker Compose:http://localhost:8000
Environment Variables
Required environment variables:SEMAPHORE_LIMIT- Control concurrency (default: 10)NEO4J_URI- Override default bolt://neo4j:7687
API Documentation
Once the service is running, interactive API documentation is available:- Swagger UI:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc - OpenAPI JSON:
http://localhost:8000/openapi.json
- All available endpoints
- Request/response schemas
- Interactive “Try it out” functionality
- Authentication requirements
Core Endpoints
Episode Management
Add Episode
Get Episodes
Search Operations
Search Facts (Entity Relationships)
Search Nodes
Entity Operations
Get Entity Edge
Delete Entity Edge
Graph Maintenance
Clear Graph
Health Check
Client Examples
Python Client
JavaScript/TypeScript Client
cURL Examples
Production Deployment
Using Docker
Kubernetes Deployment
Environment Configuration
Create a.env file:
Automated Releases
The FastAPI server container is automatically built and published when a newgraphiti-core version is released to PyPI.
Release workflow:
- Triggers when
graphiti-corePyPI release completes - Waits for PyPI package availability
- Builds multi-platform Docker image (amd64, arm64)
- Tags with version number and
latest - Pushes to Docker Hub
Monitoring
Health Checks
Implement health checks in your orchestration:Logging
The server uses structured logging. Configure log level:Metrics
FastAPI provides automatic metrics at/metrics (if prometheus client is installed).
Security
API Authentication
For production, implement authentication middleware:Rate Limiting
Implement rate limiting with slowapi:Troubleshooting
Service Won’t Start
Check logs:- Missing environment variables
- Cannot connect to Neo4j
- Port 8000 already in use
Slow Response Times
Solutions:- Increase
SEMAPHORE_LIMITfor better concurrency - Scale horizontally (multiple instances)
- Optimize Neo4j indices
- Use connection pooling
Memory Issues
Solutions:- Reduce
SEMAPHORE_LIMITto lower memory usage - Increase container memory limits
- Implement request size limits