Graphify: Query the Team Knowledge Base from Any Repo
graphify turns this knowledge-base repo into a navigable knowledge graph.
Instead of grepping or reading raw Markdown, your AI agent asks a question and
graphify returns a small, relevant sub-graph of doc nodes and the edges between
them — roughly 70x fewer tokens per answer, and it surfaces cross-document
connections you would not have thought to search for.
The graph is committed in this repo at graphify-out/graph.json, so everyone
who clones knowledge-base gets the same map with no rebuild and no API cost.
Setup
Run the team opencode bootstrap once
(opencode-ai-setup) and
answer Y to the graphify step. It:
- installs graphify and wires it into opencode,
- registers this repo’s graph into a global graph so it is reachable from any repo,
- installs the
graphify-kb-linkskill (lets the agent link the KB graph into whatever project you are in), - installs a git hook that auto-rebuilds the graph after commits (free, no LLM).
See also: Agentic Coding with OpenCode + MiniMax.
Using it in opencode
In opencode, run the /graphify command with your question — or just ask the
agent a docs question in plain language and it does this for you. No paths, no
flags:
/graphify query "how does the relay bot store tokens?"
The graphify skill checks for a graph in the current project. If you are not
inside the knowledge-base repo, it links the shared KB graph first (via the
graphify-kb-link skill), then runs the query and answers from the result.
Other commands work the same way:
/graphify explain "Bedrock Knowledge Base"
/graphify path "Relay Bot Architecture and Operations" "Bedrock Knowledge Base"
Worked example: from the hh-server repo
This is a real opencode session (model: MiniMax M3) run from the hh-server
repo — a Rails app that has nothing to do with the docs. The user typed one
command:
/graphify query "how does the relay bot store tokens?"
opencode linked the knowledge-base graph and ran the query, returning a 13-node sub-graph of the relevant docs:
Traversal: BFS depth=2 | Start: ['Relay Bot Architecture and Operations',
'Relay CI Stack Pattern', 'relay-eval-ci IAM Role'] | 13 nodes found
NODE Relay Bot Architecture and Operations [src=src/DevOps/Relay_Bot_Architecture_and_Operations.md community=119]
NODE Slack Bolt App [src=src/DevOps/Relay_Bot_Architecture_and_Operations.md community=119]
NODE Amazon Bedrock [src=src/DevOps/Relay_Bot_Architecture_and_Operations.md community=119]
NODE Bedrock Knowledge Base [src=src/DevOps/Knowledge_Base_DOCX_Drive_Retirement.md community=119]
NODE HungryHub IAM Architecture and Operations [src=src/DevOps/HungryHub_IAM_Architecture_and_Operations.md community=9]
NODE Relay CI Stack Pattern [src=src/DevOps/Relay_CI_Stack_Pattern.md community=9]
...
EDGE Relay Bot Architecture and Operations --references--> Amazon Bedrock
EDGE Relay Bot Architecture and Operations --references--> Slack Bolt App
EDGE Knowledge Base DOCX Drive Retirement --references--> Bedrock Knowledge Base
Then the agent answered, grounded in that sub-graph:
Relay bot lives at
src/DevOps/Relay_Bot_Architecture_and_Operations.md(community 119). Token-storage adjacents in the graph: Slack Bolt App (bot token / signing secret source), Amazon Bedrock (retrieval path), Knowledge Base DOCX Drive Retirement (KB token/role handoff). Token handling is detailed inside the relay bot doc (SLACK_BOT_TOKEN/SLACK_SIGNING_SECRET, SSM / Secrets Manager).
One command, from an unrelated repo: the agent found the right doc, the related services, and the likely secret-handling mechanism — without reading any file directly.
opencode commands
| Command | Use |
|---|---|
/graphify query "<q>" | Ask a natural-language question about the docs |
/graphify explain "<node>" | Plain-language explanation of one node + its neighbors |
/graphify path "<A>" "<B>" | Show how two concepts connect |
Notes
- You never pass a path or
--graphflag in opencode — the skill resolves the knowledge-base graph for you, linking it into the project first if needed. - The linked graph reflects the
knowledge-basecheckout on disk;git pullthere to pick up teammates’ doc updates. - Most of the time you do not even type
/graphify— just ask the agent a docs question in plain language and it runs the query for you.