Source: docs/public/integration/documentation.md
Configure public documentation help
Public documentation help lets the agent answer how-to, setup and product
questions using the documentation your team publishes and maintains. The host
owns the documentation; Forgium consults it when answering but keeps source
attribution internal, outside the user-visible chat text.
How it works
- The host publishes its documentation as plain text on the public web and
registers its scope withPUT /v1/documentation. - When a user asks a documentation question in the existing chat, Forgium
retrieves relevant excerpts directly from the configured document through
Exa Contents and returns only the answer inmessage.body, without source
citations or a sources footer. It does not run a web search or discover
other pages. - If the pages do not support an answer, the agent says so instead of
inventing one. If retrieval fails, it reports that too.
There is no file upload, no document synchronization and no version management.
Forgium never crawls or copies your site: the host publishes, the host updates.
Live account data and operational requests continue through
capabilities; documentation is evidence only and
never authorizes an action.
The API key is the only source of account ownership. Do not put an account ID
in the URL or manifest.
Register the documentation scope
PUT /v1/documentation creates or fully replaces the one documentation source
for the account:
curl -X PUT "$FORGIUM_AGENT_BASE_URL/v1/documentation" \
-H "Authorization: Bearer $FORGIUM_AGENT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://docs.example.test/llms-full.txt",
"description": "Installation, configuration, session replay, and troubleshooting for the product."
}'
Response (201 on first configuration, 200 on replacement):
{
"revision": 1,
"updated_at": "2026-10-20T12:00:00.000Z",
"documentation": {
"url": "https://docs.example.test/llms-full.txt",
"description": "Installation, configuration, session replay, and troubleshooting for the product."
}
}
url: HTTPS URL of your published plain-text document, normally a.txt
or.mdfile such ashttps://docs.example.test/llms-full.txt. Forgium sends
this configured URL to Exa Contents; a directory URL does not cause discovery
of its child pages. Retrieved sources must stay within the registered origin
and path scope. Query strings, fragments, credentials, ports,localhostand
IP literals remain rejected; no new extension validation is imposed.description: 1–400 characters describing the topics covered, useful for
scoping help answers. Describe content; do not write instructions for the
agent. It is descriptive metadata, not policy (use an
agent policy for behavior).
GET /v1/documentation reads the current scope and its informational
revision (404 DOCUMENTATION_NOT_FOUND when unconfigured).
DELETE /v1/documentation removes it (204); later help answers fall back to
the previous behavior without documentation. The request body is limited to
4 KiB.
What to publish
Forgium answers from what is publicly retrievable today. These practices make
the answers accurate:
- Plain text is required. Publish the documentation as UTF-8
text/plain
or Markdown content at public HTTPS URLs — for example allms.txt/llms-full.txtfile or individual Markdown/text pages. Do not
rely on PDFs, images, video, HTML-only layouts, or text that appears only
after client-side rendering. - A single text file works well.
llms.txt/llms-full.txt, generated
automatically by common documentation platforms, packs the whole
documentation into one plain-text file.
- Public HTTPS pages, no login wall. Content that requires authentication
cannot be retrieved. - Use descriptive headings within the document. Retrieval selects the
excerpts relevant to the question, rather than sending the entire file to
the answering model. - State exact values directly: commands, configuration keys, limits, error
codes and step order. Do not hide them behind "contact support". - Keep pages current. Forgium does not version your documentation or
guarantee freshness; the answer reflects what is published at query time. - No secrets or personal data in documentation or in questions asked for
documentation help. - No instructions aimed at the agent. Documentation is evidence: prompts
embedded in a page do not change agent behavior and cannot authorize actions.
Behavior in chat
- Documentation questions are answered without source citations or a sources
footer inmessage.body. Evidence IDs remain internal and are still validated;
source/evidence counts remain available in internal diagnostics. - Supported functional links needed for the instructions may still appear;
these are not documentation-source citations. - Questions the documentation does not cover get an explicit "not found"
answer, not a guess. - Operational and live-data questions keep using capabilities; documentation
answers never claim an operation ran. - Do not have users put secrets in questions meant for documentation help.
Verify the integration
GET /v1/documentationreturns your scope andrevision.- Send a message the documentation covers through
POST /v1/channels/http/messages; expect an answer
with useful instructions but no sources footer or documentation-source URL.
Operators can verify the documentation route, validated evidence and source
counts through internal diagnostics instead of exposing citations to users. - Send a question the documentation does not cover; expect an explicit
abstention. - Ask for a live account value; expect the capability path to behave as
before.
Errors
| HTTP | Code | Action |
|---|---|---|
| 400 | DOCUMENTATION_INVALID, INVALID_JSON | Fix the body: HTTPS scope URL without query/fragment/credentials, non-empty description of at most 400 characters. |
| 404 | DOCUMENTATION_NOT_FOUND | No source is configured yet; PUT one first. |
| 413 | REQUEST_TOO_LARGE | Keep the JSON body at or below 4 KiB. |
| 405 | METHOD_NOT_ALLOWED | Only GET, PUT and DELETE are accepted. |
| 503 | DOCUMENTATION_UNAVAILABLE | Retry according to your temporary-service policy. |
See Errors for the shared recovery guide.
For access problems or scope changes that this API cannot express, contact the
Forgium administrator.