Integration
Connecting an agent gives it the tools. It does not give it the habit.
Left to itself, a connected agent will mostly ignore the wiki — it has no reason to believe there is anything in there worth reading, and no prompt telling it to write anything back. The snippets on this page are what close that gap. They are the difference between a wiki that accumulates knowledge and one that stays empty next to a working MCP connection.
If you haven't connected yet, start with Connecting Your Agent.
The loop you're encoding
Every snippet below is a variation on the same four beats:
- Orient at session start — read the index, then the pages that matter
- Search before deciding — look for existing knowledge before assuming
- Write back what was learned — decisions, patterns, gotchas
- Log what happened — leave a trail of intent, not just diffs
Beat 3 is the one agents skip. Be explicit about it.
CLAUDE.md snippet
Paste into your project's CLAUDE.md:
## WitWiki Knowledge Base
This project uses WitWiki as a persistent knowledge base via MCP.
### When to read
- **Session start** — call wiki_guide for conventions, then wiki_getIndex to
orient yourself, then fetch relevant pages with wiki_getPage before diving
into unfamiliar areas
- **Before deciding** — search with wiki_listPages (use the q param) to find
existing knowledge before asking the user or making assumptions
### When to write
- **After completing work** — create or update pages with wiki_updatePage to
record decisions, patterns, and discoveries; don't let knowledge vanish at
session end
- **After significant operations** — call wiki_appendLog to record what you did
and why (ingest sessions, architectural choices, answered questions)
### Read before write
wiki_updatePage overwrites the ENTIRE page. Always wiki_getPage first and merge
your changes into what is already there. Reconcile contradictions explicitly
rather than silently clobbering them.
### Writing conventions
- Cross-reference related pages with [[wikilinks]] — also [[path|display text]]
- Keep each page focused on a single topic
- Use lowercase hyphen-separated paths; never a .md extension
- Update the index with wiki_updateIndex when adding major new pages
- Run wiki_lint after batches of edits to surface orphans and dead links
AGENTS.md snippet
For the OpenAI Agents SDK, AutoGen, LangGraph, Codex, or a custom framework —
paste into AGENTS.md:
## WitWiki Knowledge Base
This agent has access to a WitWiki knowledge base via MCP tools. Read
accumulated knowledge before starting work; record new knowledge after.
### When to read
- At task start, call wiki_guide, then wiki_getIndex to orient yourself
- Search with wiki_listPages (q parameter) before making decisions
### When to write
- After completing a task, write what you learned with wiki_updatePage
- After significant operations, append an entry with wiki_appendLog
### Read before write
wiki_updatePage is a full overwrite, not a merge. Call wiki_getPage first.
### Conventions
- Link related pages with [[wikilinks]]
- One topic per page; lowercase hyphen-separated paths, no .md extension
- Run wiki_lint periodically to find dead links and orphan pages
The tools your agent gets
Twenty, across six groups. Full parameters and return shapes are in the MCP Tool Reference.
| Group | Tools |
|---|---|
| Orientation | wiki_guide |
| Pages | wiki_getPage, wiki_updatePage, wiki_deletePage, wiki_listPages |
| Index | wiki_getIndex, wiki_updateIndex |
| Log | wiki_appendLog, wiki_getLog |
| Health | wiki_lint, wiki_rebuildGraph |
| Sources | wiki_listSources, wiki_getSource, source_upload, wiki_deleteSource, wiki_markSourceIngested |
| Projects | project_list, project_get, project_create, project_update |
Tips for a wiki worth reading
- Link aggressively. Every
[[wikilink]]builds the graph, and the graph is what makes search, backlinks, and lint useful. A page with no links in or out is nearly invisible. - One topic per page. Narrow pages are easier to update and far less likely to go stale in half their content while staying accurate in the other half.
- Keep the index honest. Agents orient from it. A stale index means agents reliably fail to find pages that exist, then write duplicates.
- Lint after batches.
wiki_lintsurfaces orphans and dead links. Fix them while you still remember the context. - Write decisions, not summaries. "We chose X over Y because Z" survives contact with the future. A restatement of what the code already says does not.
More depth on all of this in Wiki Conventions.