OpenCode plugin that gives coding agents persistent memory using Graphiti temporal knowledge graph.
This is a fork of opencode-supermemory that uses Graphiti MCP Server as the backend instead of Supermemory.
- Automatic Context Injection: User profile + project knowledge + relevant memories injected at session start
- Temporal Knowledge Graph: Graphiti tracks relationships, entities, and changes over time
- Multi-Tenant Scoping: User-scope and project-scope memory isolation via
group_id - "Remember" Trigger Detection: Automatically prompts agent to save when user says "remember this"
- Context Compaction: Saves session summaries before context window limits
- Hybrid Search: Semantic + keyword search via Graphiti MCP Server
┌──────────────────────┐ ┌─────────────────────────────────────┐
│ OpenCode Agent │ │ Graphiti MCP Server │
│ │ │ │
│ ┌────────────────┐ │ │ ┌───────────────┐ │
│ │opencode-graphiti│─┼─────┼─▶│ MCP Tools │ │
│ │ (plugin) │ │HTTP │ │ (add_memory, │ │
│ └────────────────┘ │ │ │ search_nodes)│ │
│ │ │ └───────┬───────┘ │
│ No API keys needed │ │ │ │
│ Just HTTP calls │ │ ┌───────▼───────┐ ┌────────────┐ │
└──────────────────────┘ │ │ Graphiti │ │ OpenAI API │ │
│ │ (Knowledge │──│ (Embedding │ │
│ │ Graph) │ │ + LLM) │ │
│ └───────┬───────┘ └────────────┘ │
│ │ │
│ ┌───────▼───────┐ │
│ │ FalkorDB │ │
│ └───────────────┘ │
└─────────────────────────────────────┘
git clone https://github.com/getzep/graphiti.git
cd graphiti/mcp_server
cp .env.example .env
docker compose up -dbunx opencode-graphiti@latest installOr manually add to ~/.config/opencode/opencode.jsonc:
Create ~/.config/opencode/graphiti.jsonc:
{
// Graphiti MCP Server URL (기본값)
"mcpUrl": "http://localhost:8000/mcp/",
// Group ID prefix
"groupIdPrefix": "opencode",
// Search limits
"maxMemories": 5,
"maxProjectMemories": 10
}Or use environment variable:
export GRAPHITI_MCP_URL="http://localhost:8000/mcp/"Start OpenCode and run:
/graphiti-init
- First message: Profile + project memories + relevant context injected
- "Remember" triggers: Agent prompted to save when you say "remember", "save this", etc.
- Session compaction: Summaries saved to memory before context limits
graphiti(mode: "add", content: "Uses Bun for package management", type: "project-config", scope: "project")
graphiti(mode: "search", query: "testing patterns")
graphiti(mode: "list", scope: "project", limit: 20)
graphiti(mode: "profile")
graphiti(mode: "forget", memoryId: "uuid-here")
graphiti(mode: "status")
| Scope | Description | Use For |
|---|---|---|
user |
Cross-project | Personal preferences, coding style |
project |
This repo only | Build commands, architecture, conventions |
project-config- Tech stack, commands, toolingarchitecture- Codebase structure, data flowlearned-pattern- Project-specific conventionserror-solution- Known issues and fixespreference- Coding style preferencesconversation- Session summaries
- OpenCode 1.0+
- Graphiti MCP Server running (provides its own LLM/embedding)
Check logs at ~/.opencode-graphiti.log
Verify Graphiti is running:
curl http://localhost:8000/healthMIT
- Original opencode-supermemory by Supermemory
- Graphiti by Zep
{ "plugin": ["opencode-graphiti@latest"] }