Technical Documentation: getzep/zep
โน๏ธ Provenance: Multi-Tier Ingestion ยท CodeWiki Reference
Overview (README.md)
Zep Cloud: Examples & Integrations
About This Repository
This repository is not Zep's product or service. It contains example code, framework
integrations, and tools for building agent memory with Zep Cloud,
Zep's managed agent memory platform.
To use Zep Cloud, sign up at www.getzep.com and read the
documentation at help.getzep.com. Zep's official SDKs are:
- Python:
pip install zep-cloud - TypeScript/JavaScript:
npm install @getzep/zep-cloud - Go:
go get github.com/getzep/zep-go/v3
Looking for the open-source temporal knowledge graph framework that powers Zep? See
Graphiti.
Contents
| Project / directory | Description |
|---|---|
examples/ |
Example apps and snippets in Python, TypeScript, and Go |
integrations/ |
Agent-framework integration packages |
ingestion/ |
zep-ingest โ bulk data ingestion pipeline (Slack, documents, email, JSON/CSV, fact triples) |
ontology/ |
Default ontology definitions |
| Build with Zep | Agent plugin for Claude Code, Codex, and Cursor (separate repository) |
| Zep Memory | Agent plugin for Claude Desktop/Cowork and ChatGPT Work (separate repository) |
benchmarks/ |
Memory benchmarks (LoCoMo, LongMemEval) |
zep-eval-harness/ |
Evaluation harness for ingestion and retrieval |
legacy/ |
Deprecated Zep Community Edition (unsupported) |
Integrations
Framework integration packages live under integrations/, organized
framework-first then language: integrations/<framework>/<language>/. Each package is built,
tested, and released independently.
- Python: Google ADK, Microsoft Agent Framework, Microsoft AutoGen, AG2, CrewAI, LangGraph, LiveKit, Pydantic AI, Strands Agents
- TypeScript: Google ADK, Mastra, Vercel AI SDK
- Go: Google ADK
See integrations/README.md for packages, release status, and
links, and integrations/CLAUDE.md for conventions.
Contributing
We welcome contributions. See CONTRIBUTING.md for guidelines covering code,
documentation, bug reports, and community examples.
Community Edition (Deprecated)
Zep Community Edition is no longer supported. Its code has been moved to thelegacy/ folder. Read more in
Announcing a New Direction for Zep's Open Source Strategy.
Mcp Zep Mcp Server Docs DOCKER (`mcp/zep-mcp-server/docs/DOCKER.md`)
Docker Deployment Guide
This guide covers deploying the Zep MCP Server using Docker and Docker Compose.
Quick Start
Create environment file:
bashcp .env.example .env # Edit .env and add your ZEP_API_KEYStart with Docker Compose:
bashdocker-compose up
The server will be available at http://localhost:8080.
Docker Build
Building the Image
Build the Docker image manually:
docker build -t zep-mcp-server:latest .Or use the build script:
./scripts/build.shBuild Arguments
VERSION: Set the version string (default: 0.1.0)
docker build --build-arg VERSION=1.0.0 -t zep-mcp-server:1.0.0 .Multi-Platform Builds
Build for multiple platforms:
docker buildx build \
--platform linux/amd64,linux/arm64 \
-t zep-mcp-server:latest \
.Running with Docker
Run with Environment Variables
docker run -d \
--name zep-mcp-server \
-e ZEP_API_KEY=your-key-here \
-p 8080:8080 \
zep-mcp-server:latestRun with Environment File
docker run -d \
--name zep-mcp-server \
--env-file .env \
-p 8080:8080 \
zep-mcp-server:latestRun with Custom Port
docker run -d \
--name zep-mcp-server \
-e ZEP_API_KEY=your-key-here \
-p 9000:8080 \
zep-mcp-server:latest \
--port 8080Run in Stdio Mode
For use with Claude Desktop or Cline:
docker run -i \
--name zep-mcp-server \
-e ZEP_API_KEY=your-key-here \
zep-mcp-server:latest \
--stdioDocker Compose
Starting the Server
Start in background:
docker-compose up -dStart with logs:
docker-compose upStopping the Server
docker-compose downViewing Logs
docker-compose logs -fChecking Status
docker-compose psRestarting the Server
docker-compose restartConfiguration
Environment Variables
Set these in .env file or pass via -e flag:
- ZEP_API_KEY (required): Your Zep Cloud API key
- LOG_LEVEL (optional): Logging level (debug, info, warn, error) - default: info
docker-compose.yml
The compose file includes:
- Health checks: Automatic health monitoring
- Resource limits: CPU and memory constraints
- Security: Non-root user, read-only filesystem, no new privileges
- Logging: Configured with rotation (10MB max, 3 files)
- Restart policy: Automatically restarts unless stopped manually
Customizing docker-compose.yml
Edit resource limits:
deploy:
resources:
limits:
cpus: '2'
memory: 256MChange port mapping:
ports:
- "9000:8080"Health Checks
The Docker container includes health checks that verify the server is responding on port 8080.
Check health status:
docker inspect --format='{{.State.Health.Status}}' zep-mcp-serverView health check logs:
docker inspect --format='{{range .State.Health.Log}}{{.Output}}{{end}}' zep-mcp-serverSecurity
Non-Root User
The container runs as user zep (UID 1001) for security.
Read-Only Filesystem
The container uses a read-only root filesystem with only /tmp as writable.
Security Options
no-new-privileges: Prevents privilege escalation- Minimal Alpine base image with only essential packages
Troubleshooting
Container Won't Start
Check logs:
docker-compose logsVerify environment variables:
docker-compose configConnection Issues
Verify port mapping:
docker psTest connectivity:
curl http://localhost:8080Health Check Failures
Check health status:
docker inspect zep-mcp-server | grep -A 10 HealthPermission Issues
Ensure the container can write to /tmp:
docker exec zep-mcp-server ls -la /tmpProduction Deployment
Using Docker Compose
The included docker-compose.yml is configured for production with:
- Automatic restarts
- Resource limits
- Health checks
- Security hardening
- Log rotation
Best Practices
Use secrets management for ZEP_API_KEY:
- Docker secrets
- Kubernetes secrets
- Cloud provider secret managers
Monitor resource usage:
bashdocker stats zep-mcp-serverSet up log aggregation:
- Configure Docker logging driver for your platform
- Use centralized logging (CloudWatch, Datadog, etc.)
Enable automatic updates:
- Use Watchtower or similar tools
- Set up CI/CD pipeline
Use specific version tags:
bashdocker build -t zep-mcp-server:1.0.0 .
Makefile Integration
Use make commands for common Docker operations:
# Build Docker image
make docker-build
# Run with Docker Compose
make docker-run
# Stop Docker Compose
make docker-down
# Clean Docker resources
make docker-cleanRegistry Publishing
Tag for Registry
docker tag zep-mcp-server:latest your-registry.com/zep-mcp-server:latestPush to Registry
docker push your-registry.com/zep-mcp-server:latestPull from Registry
docker pull your-registry.com/zep-mcp-server:latestAdvanced Usage
Custom Entrypoint
Override the entrypoint for debugging:
docker run -it --entrypoint /bin/sh zep-mcp-server:latestVolume Mounting
Mount configuration files:
docker run -v $(pwd)/.env:/app/.env zep-mcp-server:latestNetwork Configuration
Use custom networks:
docker network create zep-network
docker run --network zep-network zep-mcp-server:latestCI/CD Integration
GitHub Actions Example
- name: Build Docker image
run: docker build -t zep-mcp-server:${{ github.sha }} .
- name: Run tests
run: docker run zep-mcp-server:${{ github.sha }} make test
- name: Push to registry
run: |
docker tag zep-mcp-server:${{ github.sha }} registry/zep-mcp-server:latest
docker push registry/zep-mcp-server:latestSupport
For issues or questions:
Mcp Zep Mcp Server Docs TOOLS (`mcp/zep-mcp-server/docs/TOOLS.md`)
Tool Reference
Complete reference for all tools provided by the Zep MCP Server.
Table of Contents
- search_graph
- get_user_context
- get_user
- list_threads
- get_user_nodes
- get_user_edges
- get_episodes
- get_thread_messages
- get_node
- get_edge
- get_episode
- get_node_edges
- get_episode_mentions
search_graph
Search the Zep knowledge graph for relevant information about a user.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
user_id |
string | Yes | User ID to search within |
query |
string | Yes | Search query text |
scope |
string | No | Search scope: edges, nodes, or episodes (default: edges) |
limit |
integer | No | Maximum results (default: 10, max: 50) |
reranker |
string | No | Reranking strategy: rrf, mmr, node_distance, episode_mentions, cross_encoder |
min_fact_rating |
number | No | Minimum fact rating threshold for filtering results |
mmr_lambda |
number | No | Weighting for maximal marginal relevance reranking |
center_node_uuid |
string | No | Node UUID to rerank around for node_distance reranking |
node_labels |
array[string] | No | Filter results by node labels |
edge_types |
array[string] | No | Filter results by edge types |
Returns
JSON object containing edges, nodes, and/or episodes depending on the search scope.
Example
{
"user_id": "alice_123",
"query": "What are Alice's dietary preferences?",
"scope": "edges",
"limit": 5,
"reranker": "cross_encoder",
"edge_types": ["PREFERS", "LIKES"]
}Use Cases
- Finding specific facts about a user
- Retrieving relationship information
- Discovering relevant entities
- Building context for conversations
- Filtering by entity or relationship type
get_user_context
Retrieve formatted context string for a conversation thread. Returns facts and entities relevant to the thread.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
thread_id |
string | Yes | Thread (conversation) identifier |
template_id |
string | No | Context template ID for custom context rendering |
Returns
JSON object containing:
context: Formatted context string with facts and entities
Example
{
"thread_id": "conversation_456",
"template_id": "my_custom_template"
}Use Cases
- Getting conversation-relevant context for prompts
- Building context-aware AI responses
- Using custom templates for structured context output
get_user
Retrieve user information and metadata from Zep.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
user_id |
string | Yes | User identifier |
Returns
JSON object containing user properties including user_id, email, first_name, last_name, created_at, and associated metadata.
Example
{
"user_id": "alice_123"
}Use Cases
- Getting user profile information
- Checking if a user exists
- Retrieving user metadata
list_threads
List all conversation threads for a specific user.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
user_id |
string | Yes | User identifier |
Returns
JSON array of thread objects containing thread_id, user_id, created_at, updated_at, and metadata.
Example
{
"user_id": "alice_123"
}Use Cases
- Browsing user's conversation history
- Thread discovery
- Analyzing conversation patterns
get_user_nodes
Retrieve entity nodes from a user's knowledge graph. Nodes represent people, places, concepts, and other entities.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
user_id |
string | Yes | User identifier |
limit |
integer | No | Maximum nodes to return (default: 20) |
Returns
JSON array of node objects containing uuid, name, labels, summary, created_at, and additional properties.
Example
{
"user_id": "alice_123",
"limit": 10
}Use Cases
- Exploring entities in user's knowledge graph
- Understanding user's context and relationships
- Finding specific types of entities
get_user_edges
Retrieve edges (relationships/facts) from a user's knowledge graph.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
user_id |
string | Yes | User identifier |
limit |
integer | No | Maximum edges to return (default: 20) |
Returns
JSON array of edge objects containing uuid, source_node_uuid, target_node_uuid, edge_type, fact, valid_at, and created_at.
Example
{
"user_id": "alice_123",
"limit": 10
}Use Cases
- Examining relationships between entities
- Understanding fact provenance
- Temporal fact analysis
get_episodes
Retrieve temporal episodes (events) from a user's knowledge graph history.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
user_id |
string | Yes | User identifier |
lastn |
integer | No | Return the last N episodes (default: 10) |
Returns
JSON array of episode objects containing uuid, content, source, created_at, and metadata.
Example
{
"user_id": "alice_123",
"lastn": 5
}Use Cases
- Accessing temporal data ingestion events
- Understanding conversation history context
- Analyzing data provenance
get_thread_messages
Retrieve messages from a conversation thread.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
thread_id |
string | Yes | Thread identifier |
lastn |
integer | No | Number of most recent messages to return (overrides limit) |
limit |
integer | No | Maximum number of messages to return |
Returns
JSON object containing messages with role, content, uuid, and timestamps.
Example
{
"thread_id": "conversation_456",
"lastn": 10
}Use Cases
- Reading conversation history
- Retrieving recent messages for context
- Auditing conversation content
get_node
Retrieve a specific knowledge graph node (entity) by its UUID.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
uuid |
string | Yes | The UUID of the node to retrieve |
Returns
JSON object containing the full node details including uuid, name, labels, summary, and properties.
Example
{
"uuid": "550e8400-e29b-41d4-a716-446655440000"
}Use Cases
- Getting full details of a node discovered via search
- Following up on entities returned by other tools
get_edge
Retrieve a specific knowledge graph edge (relationship/fact) by its UUID.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
uuid |
string | Yes | The UUID of the edge to retrieve |
Returns
JSON object containing the full edge details including uuid, source_node_uuid, target_node_uuid, edge_type, fact, and temporal data.
Example
{
"uuid": "550e8400-e29b-41d4-a716-446655440001"
}Use Cases
- Getting full details of an edge discovered via search
- Understanding a specific relationship or fact
get_episode
Retrieve a specific episode by its UUID.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
uuid |
string | Yes | The UUID of the episode to retrieve |
Returns
JSON object containing the full episode details including uuid, content, source, and metadata.
Example
{
"uuid": "550e8400-e29b-41d4-a716-446655440002"
}Use Cases
- Getting full details of a specific episode
- Examining episode content and metadata
get_node_edges
Retrieve all edges (relationships/facts) connected to a specific node.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
node_uuid |
string | Yes | The UUID of the node to get edges for |
Returns
JSON array of edge objects connected to the specified node.
Example
{
"node_uuid": "550e8400-e29b-41d4-a716-446655440000"
}Use Cases
- Exploring all relationships of a specific entity
- Graph traversal from a node
- Understanding an entity's connections
get_episode_mentions
Retrieve nodes and edges mentioned in a specific episode.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
uuid |
string | Yes | The UUID of the episode |
Returns
JSON object containing nodes and edges arrays โ the entities and relationships mentioned in the episode.
Example
{
"uuid": "550e8400-e29b-41d4-a716-446655440002"
}Use Cases
- Understanding what entities and facts were extracted from an episode
- Tracing data provenance from episodes to graph elements
- Auditing knowledge graph construction
Common Patterns
Combining Tools
Tools can be combined for powerful workflows:
// 1. Get user threads
const threads = await tools.list_threads({ user_id: "alice_123" });
// 2. Get context for most recent thread
const context = await tools.get_user_context({
thread_id: threads[0].thread_id
});
// 3. Search graph for specific information
const preferences = await tools.search_graph({
user_id: "alice_123",
query: "dietary preferences",
scope: "edges"
});
// 4. Drill into a specific node
const node = await tools.get_node({
uuid: preferences.nodes[0].uuid
});
// 5. Get all relationships for that node
const relationships = await tools.get_node_edges({
node_uuid: node.uuid
});Error Handling
All tools return standard MCP errors:
- 400 Bad Request: Invalid parameters
- 401 Unauthorized: Invalid API key
- 404 Not Found: User, thread, or resource not found
- 500 Internal Server Error: Server or API error
Performance Optimization
- Limit results with
limitandlastnparameters - Use search filters (
node_labels,edge_types) to narrow results - Use specific UUIDs when you know the exact entity you need
Temporal Queries
Many results include temporal information:
valid_at: When a fact is valid (edges)created_at: When data was createdupdated_at: When data was last modified
Use this information for temporal reasoning and context.
Need Help?
Ingestion Examples Data Docs Company Handbook (`ingestion/examples/data/docs/company_handbook.md`)
Alder Ridge Robotics โ Company Handbook
Purpose
Alder Ridge Robotics designs automation systems for fulfillment centers. The
company's current product portfolio includes ROBOT-101, ROBOT-202, and the
OPERATIONS-DASHBOARD monitoring service.
Organization
Avery Brown is vice president of engineering and works from North Campus.
Blake Carter leads the ROBOT-202 program. Casey Nguyen is chief technology
officer and owns the software portfolio, including OPERATIONS-DASHBOARD.
Robotics portfolio
ROBOT-101 is the company's standard picking arm. ROBOT-202 is the next model
in the product line and was called PROTOTYPE-202 during early development.
Internal documentation should use ROBOT-202 as the canonical name.
Operations software
OPERATIONS-DASHBOARD provides equipment status, utilization, and alert history.
Engineering owns release quality, while customer operations manages access and
onboarding.
Supplier relationship
Westbridge Components supplies the ACTUATOR-09 assembly used by ROBOT-202.
Devon Brooks manages the account. Component orders require a six-week lead time,
and engineering must approve substitutions before purchase orders are issued.
Fulfillment evaluation
Clearwater Fulfillment operates four ROBOT-101 units at South Warehouse. Morgan
Lee manages the site evaluation and coordinates weekly reviews with Alder Ridge
Robotics. Evertrail Freight Group uses the same support process for its regional
operations team.
Information handling
Operational reports are shared only with project members. Do not place access
tokens, credentials, or personal contact information in project notes. Report
security concerns to the engineering lead.
--- METRICS ---
- Files Extracted: 4
- Estimated Token Budget: ~5700 tokens
- Canonical Reference: https://codewiki.google/github.com/getzep/zep