Setup guide for running a local cognee instance as the long-term memory backend for opencode, using OpenRouter for the LLM + embeddings (no OpenAI key needed).
What you get:
- opencode auto-captures every tool execution into cognee, structured per project (
ocp-<project>dataset per working directory + anopencode-sharedcross-project dataset) - a project descriptor (name, path, git origin) is stored on first contact, giving the graph context about what project captured output belongs to
- relevant memories are injected back on context compaction (auto-recall)
- two extra agent tools:
cognee_remember(store a fact) andcognee_search(query the graph)