Skip to main content
The Graphiti REST API service provides HTTP endpoints for interacting with the knowledge graph, built with FastAPI for high performance and automatic API documentation.

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 release
  • 0.22.1 - Specific version (matches graphiti-core version)
Supported platforms: linux/amd64, linux/arm64

Quick Start

Using Docker Compose

The fastest way to get started is with Docker Compose:
Start the service:
The API will be available at http://localhost:8000

Environment Variables

Required environment variables:
Optional 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
These automatically generated docs include:
  • All available endpoints
  • Request/response schemas
  • Interactive “Try it out” functionality
  • Authentication requirements

Core Endpoints

Episode Management

Add Episode

Response:

Get Episodes

Response:

Search Operations

Search Facts (Entity Relationships)

Response:

Search Nodes

Response:

Entity Operations

Get Entity Edge

Response:

Delete Entity Edge

Graph Maintenance

Clear Graph

Response:

Health Check

Response:

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 new graphiti-core version is released to PyPI. Release workflow:
  1. Triggers when graphiti-core PyPI release completes
  2. Waits for PyPI package availability
  3. Builds multi-platform Docker image (amd64, arm64)
  4. Tags with version number and latest
  5. Pushes to Docker Hub
Only stable releases are built (pre-releases are skipped).

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:
Common issues:
  • Missing environment variables
  • Cannot connect to Neo4j
  • Port 8000 already in use

Slow Response Times

Solutions:
  • Increase SEMAPHORE_LIMIT for better concurrency
  • Scale horizontally (multiple instances)
  • Optimize Neo4j indices
  • Use connection pooling

Memory Issues

Solutions:
  • Reduce SEMAPHORE_LIMIT to lower memory usage
  • Increase container memory limits
  • Implement request size limits

Next Steps