Wiki Sources
A wiki source is a knowledge source that the agent can both read and write. Instead of being a fixed set of ingested files, a wiki is a small set of Markdown pages that the LLM edits over time — recording what it learns, correcting stale information, and building living documentation. Humans can edit the same pages directly, and every change is stamped with who made it.
Unlike a classic source, a wiki is team-scoped, not per-user: it is shared and edited at the source level, so a whole team works against the same living document.
How a wiki differs from a classic source
| Classic source | Wiki source | |
|---|---|---|
| Content | Ingested files, read-only | Markdown pages, read and write |
| Who edits | You (re-upload to change) | The agent and humans |
| Default exposure | prefetch (chunks injected up front) | agentic_tool (the agent browses pages on demand) |
| Searchability | Embedded at ingest | Re-embedded automatically on every edit |
| Scope | Per owner | Team-shareable, edited at source scope |
Because a wiki defaults to the agentic_tool exposure, the agent navigates it as a tool — opening, searching, and editing pages as needed — rather than receiving a bulk prefetch.
How the agent edits a wiki
The agent edits a wiki through an internal Wiki tool that is automatically scoped to one wiki source. It supports a small, edit-safe action surface:
- view a page,
- create or overwrite a page,
- str_replace an exact, unique string,
- insert at a line,
- delete a page,
- rename a page.
Two safety properties matter:
- Provenance stamps. Every page records whether its last change came from a human or the agent, so edits are traceable.
- Optimistic versioning. Edits carry an expected version; if a page changed underneath, the edit is rejected rather than silently clobbering a concurrent change. String replacements must match exactly and uniquely.
After any edit, the affected page is re-embedded asynchronously so the wiki stays searchable and the new content is immediately retrievable.
Each wiki page is capped at 1 MB (1,000,000 bytes). Pages are addressed by path (the home page is /index.md).
Creating a wiki
In the UI, open Settings → Knowledge, choose Add knowledge, then New wiki. From the API:
curl -X POST https://your-docsgpt/api/sources/wiki \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{ "name": "Team Handbook", "initial_content": "# Team Handbook\n\nWelcome." }'name(required) — the wiki source name.initial_content(optional) — Markdown that seeds the home page/index.mdand triggers its first re-embed.
No ingestion task runs for a wiki; pages are authored directly. The response returns the new source_id.
Converting an existing source into a wiki
You can turn an already-ingested source into a wiki so the agent can start maintaining it:
curl -X POST https://your-docsgpt/api/sources/<source_id>/wiki/convert \
-H "Authorization: Bearer <token>"- A blank source is enabled inline (no task) and immediately becomes a wiki.
- A source with files runs a conversion task that reassembles its existing chunks into wiki pages; poll the returned task for a per-file summary.
- Conversion is rejected with
409if the source is still ingesting — wait for it to finish first.
Switching a source to (or from) wiki mode goes only through POST /api/sources/<id>/wiki/convert. It cannot be done through the config PATCH endpoint.
Reading and editing pages directly
Humans can read and edit wiki pages through the API (and the wiki viewer in the UI):
GET /api/sources/<source_id>/wiki/pages # list pages
GET /api/sources/<source_id>/wiki/page?path=... # fetch one page fresh
PUT /api/sources/<source_id>/wiki/page # create or overwrite a page (human edit)Human edits are stamped with human provenance and trigger the same re-embed as agent edits. Read access follows source sharing (owner or anyone the source is shared with); writing requires owner or team editor access.
Edits from the API, widget and public links
An agent called with its API key (the website widget, the API) runs as its owner, so it could change any wiki the owner can edit. By default it can’t: API and widget users can still read the wiki through the agent, but the agent isn’t offered the create, edit, delete or rename actions in those chats, and the Wiki tool refuses them if it’s asked anyway.
The wiki’s owner can allow such edits. On Settings → Knowledge, open the wiki’s menu, choose Wiki settings, and turn on Let API and widget users edit this wiki. The change applies from the next message, including in chats that are already open. Only the owner sees it; team editors can’t change it. You and the wiki’s editors can always edit it in DocsGPT, and so can agents you or they use there.
The switch doesn’t cover public links. People who open an agent from its public link run it as themselves, so they can only edit wikis they could edit anyway (their own, or ones shared with them as an editor). Because the agent’s prompt and sources belong to someone else, each of their wiki edits waits for their approval in the chat before it runs. A research agent can’t stop to ask, so in a public-link chat it reads the wiki but doesn’t edit it.
Scheduled and webhook runs get the Wiki tool too, and run as the agent’s owner:
- A webhook run counts as an outside caller, because whoever holds the webhook URL decides its input. It can read the wiki, and edits it only when the switch above is on.
- A schedule set through the API, or by someone who reaches the agent only through its public link, counts as an outside caller in the same way.
- A schedule set in the app (the agent’s Schedules tab, or a task the owner or a teammate set from chat) is the owner’s own automation, so it edits the wiki as the agent’s owner can.
Nobody is there to approve anything in these runs, so no wiki edit waits for approval. An agent whose owner can only view the wiki gets no Wiki tool, as in a chat.
With authentication off (AUTH_TYPE=None, the default), every request, including one from the widget or the API, runs as the same local user who owns the agents. The switch then can’t tell outside callers from you and has no effect, so turn authentication on if others can reach the widget or the API.
From the API, only a signed-in session can change the setting; a personal access token can read it but not change it:
GET /api/sources/<source_id>/wiki/settings # {"allow_outside_edits": false, ...}
PUT /api/sources/<source_id>/wiki/settings # owner only; body {"allow_outside_edits": true}Related
- Per-Source Configuration — exposure and retrieval settings a wiki uses.
- Access Control & Teams — sharing a wiki with a team, and what an agent’s users reach when you share the agent.
- Connectors — what else an agent can and can’t do for API, widget and public-link users.