Zilmac Блог
← К статьям

Graphify + OpenCode: как дать open-source coding agent память о структуре проекта

API и агенты ·~13 мин

Разработчик запрашивает локальный граф Graphify из OpenCode на Mac

OpenCode is one of the most discussed open-source terminal coding agents in 2026: multi-model, self-hostable, and AGENTS.md-friendly. Its default “memory” is still session-scoped—switch machines, open a new session, or lose context to a huge xcodebuild log, and the agent is back to grep and random file reads.

For reviewable, incrementally updatable, file:line-backed project structure memory, the official Graphify + OpenCode integration is practical: build a local graphify-out/ knowledge graph, wire it through AGENTS.md and an opencode.json plugin, and make the agent run graphify query / path / explain before editing. Compare terminal agents in Claude Code alternatives 2026; for cross-session user preferences, see Mem0 vs Zep vs TencentDB Agent Memory.

Local
Graph in graphify-out/graph.json
3
Core queries: query · path · explain
AST
graphify update — no LLM cost for refresh

OpenCode needs structure memory, not just a bigger model

Terminal agents usually fail by navigating wrong: editing the wrong package, re-implementing existing utils, or describing auth flows from stale files. Graphify maps imports, symbols, and communities into a traversable graph with path:line citations; the OpenCode integration bakes “query the graph” into the workflow (official guide).

What Graphify is (and is not)

Document RAG answers prose; Graphify answers where code connects. Edges are tagged EXTRACTED, INFERRED, or AMBIGUOUS so agents know what was parsed vs guessed—aligned with tool-first agent stacks in our AI agent stack overview.

Graphify knowledge graph visualization with OpenCode terminal queries
Open graphify-out/graph.html for exploration; agents use CLI or MCP for token-budgeted subgraphs.

Outputs in graphify-out/

Typical artifacts: graph.json, graph.html, GRAPH_REPORT.md. OpenCode wiring adds reviewable AGENTS.md rules and an opencode.json plugin that nudges the agent before bash-heavy exploration.

Install: uv, platform flag, --project

uv tool install graphifyy
graphify opencode install --project

Pitfall: plain graphify install targets Claude Code

Run graphify claude uninstall if needed, then graphify opencode install. See the integration page.

OpenCode setup: opencode.ai/docs. Graph building is AST-first and does not spend chat-model tokens.

Build the graph in OpenCode

/graphify .
cd /path/to/repo && graphify .

Use graphify . --update for incremental sync; --mode deep for richer INFERRED edges.

Query commands: graph first, edit second

CommandUse
graphify query "…"Token-budgeted subgraph for a question
graphify path "A" "B"Shortest dependency path
graphify explain "Symbol"Neighborhood summary with citations
graphify query "webhook signature verification" --budget 1500

AGENTS.md + plugin

Rules typically require Graphify for architecture questions, graphify update . after edits, and explicit handling of AMBIGUOUS edges. The plugin reminds the agent before wholesale find/grep scans.

Optional MCP

uv tool install "graphifyy[mcp]"
{"mcpServers":{"graphify":{"command":"graphify-mcp","args":["/absolute/path/graphify-out/graph.json"]}}}

See Graphify MCP docs. Verify with graph_stats, then query_graph.

Keeping the graph fresh

  • graphify update . — changed files only
  • graphify hook install — git hooks
  • graphify . --watch — filesystem watch

Teams: remote Mac & monorepos

Install Graphify on the same Mac that runs OpenCode (including Zilmac cloud Mac for iOS builds). Stale graphs are worse than none—automate update on main. For monorepos, scope the root or merge graphs per Graphify skill docs.

FAQ

Graphify vs Mem0/Zep?

Graphify = repo topology; Mem0/Zep = user/task memory across sessions. Use both when needed.

Will a large graph slow OpenCode?

Queries return bounded subgraphs; cost is usually the initial build.

Claude Code + Graphify on one machine?

Fine—use platform-specific install commands.

OpenCode executes; Graphify remembers structure you can verify. Wire with graphify opencode install --project, build with /graphify ., query before you edit, and refresh with update and hooks.

Акция

Zilmac

Облачный Mac и Mac VPS для iOS и кроссплатформенных команд.

На главную
Акция Тарифы