Documentation Index
Fetch the complete documentation index at: https://docs.kiwifs.com/llms.txt
Use this file to discover all available pages before exploring further.
Health dashboard
Get an overview of your knowledge base health.
curl 'http://localhost:3333/api/kiwi/analytics'
{
"total_pages": 142,
"stale_pages": 8,
"orphan_pages": 5,
"broken_links": 3,
"empty_pages": 1,
"pages_without_frontmatter": 12,
"link_coverage_pct": 96.5,
"recently_updated": [
{"path": "concepts/auth.md", "updated": "2026-04-25T14:30:00Z"},
{"path": "concepts/billing.md", "updated": "2026-04-24T09:15:00Z"}
]
}
Pages past their review-by date in frontmatter.
Pages with no incoming backlinks.
Wiki links pointing to nonexistent pages.
Pages with no content beyond frontmatter.
pages_without_frontmatter
Pages missing YAML frontmatter.
Percentage of wiki links that resolve to existing pages.
Most recently modified pages.
Per-page health check
Analyze the health of a single page.
curl 'http://localhost:3333/api/kiwi/health-check?path=concepts/auth.md'
{
"path": "concepts/auth.md",
"word_count": 342,
"link_count": 5,
"backlink_count": 8,
"days_since_update": 2,
"issues": []
}
When issues are detected, they appear in the issues array:
{
"issues": [
{"type": "stale", "message": "Page is 45 days past its review date"},
{"type": "broken_link", "message": "Link [[payments-v1]] does not resolve"}
]
}
Stale pages
List pages that are past their review date.
curl 'http://localhost:3333/api/kiwi/stale'
[
{
"path": "concepts/legacy-auth.md",
"title": "Legacy Authentication",
"review_by": "2026-03-01",
"days_overdue": 55
}
]
Contradictions
Detect pages with potentially conflicting claims.
curl 'http://localhost:3333/api/kiwi/contradictions'
[
{
"pages": ["concepts/auth.md", "runbooks/login-flow.md"],
"claim": "session timeout duration",
"details": "auth.md says 30 minutes, login-flow.md says 1 hour"
}
]
Janitor scan
Run a full knowledge health scan across the entire knowledge base.
curl 'http://localhost:3333/api/kiwi/janitor'
{
"stale": 8,
"orphans": 5,
"broken_links": 3,
"empty": 1,
"missing_frontmatter": 12,
"recommendations": [
"Link orphan page concepts/caching.md from a parent topic",
"Update stale page runbooks/deploy-v1.md (90 days overdue)",
"Fix broken link [[payments-v1]] in concepts/billing.md"
]
}
Memory report
Get an overview of your episodic memory structure — useful for agents that use the episode/merge pattern.
GET /api/kiwi/memory/report
Path prefix for episodes directory. Uses the configured default if omitted.
curl 'http://localhost:3333/api/kiwi/memory/report'
{
"episodic_count": 23,
"merged_from_refs": 15,
"episodic_files": ["episodes/ep-001.md", "episodes/ep-002.md"],
"unmerged": 8,
"warnings": ["Episode ep-012.md has no merge target"]
}
Context
Retrieve the knowledge base context files used by agents — the playbook, schema description, and index.
curl 'http://localhost:3333/api/kiwi/context'
{
"playbook": "# Playbook\n\nRules for how agents should interact...",
"schema": "# Schema\n\nFrontmatter fields and their meanings...",
"index": "# Index\n\nTop-level knowledge structure..."
}
These map to .kiwi/playbook.md, .kiwi/SCHEMA.md, and .kiwi/index.md.
Theme
Read or update the web UI theme.
Get theme
curl 'http://localhost:3333/api/kiwi/theme'
Set theme
curl -X PUT 'http://localhost:3333/api/kiwi/theme' \
-H "Content-Type: application/json" \
-d '{"primary": "#6cbe45", "mode": "light"}'
Returns 403 if ui.theme_locked = true in configuration.
Add, list, resolve, and delete inline comments on pages.
File path to list comments for.
curl 'http://localhost:3333/api/kiwi/comments?path=concepts/auth.md'
[
{
"id": "cmt_01",
"path": "concepts/auth.md",
"line": 15,
"author": "agent:reviewer",
"body": "Should this mention refresh tokens?",
"resolved": false,
"created": "2026-04-25T10:00:00Z"
}
]
curl -X POST 'http://localhost:3333/api/kiwi/comments?path=concepts/auth.md' \
-H "Content-Type: application/json" \
-H "X-Actor: agent:reviewer" \
-d '{"line": 15, "body": "Should this mention refresh tokens?"}'
curl -X PATCH 'http://localhost:3333/api/kiwi/comments/cmt_01' \
-H "Content-Type: application/json" \
-d '{"resolved": true}'
curl -X DELETE 'http://localhost:3333/api/kiwi/comments/cmt_01'
Sharing
Create and manage share links for pages.
Create a share link
curl -X POST 'http://localhost:3333/api/kiwi/share' \
-H "Content-Type: application/json" \
-d '{"path": "concepts/auth.md", "expires_in": "7d", "password": "optional-secret"}'
{
"id": "shr_abc123",
"url": "http://localhost:3333/s/shr_abc123",
"path": "concepts/auth.md",
"expires": "2026-05-02T14:30:00Z"
}
List share links
curl 'http://localhost:3333/api/kiwi/share'
Revoke a share link
curl -X DELETE 'http://localhost:3333/api/kiwi/share/shr_abc123'
Real-time events (SSE)
Subscribe to a Server-Sent Events stream that emits events on every write and delete. Use this for real-time UI updates or external integrations.
curl -N 'http://localhost:3333/api/kiwi/events'
event: write
data: {"path":"concepts/auth.md","actor":"agent:docs-writer","timestamp":"2026-04-25T14:30:00Z"}
event: delete
data: {"path":"concepts/old-page.md","actor":"agent:cleanup","timestamp":"2026-04-25T14:31:00Z"}
event: write
data: {"path":"concepts/billing.md","actor":"agent:importer","timestamp":"2026-04-25T14:32:00Z"}
The SSE connection stays open indefinitely. Use curl -N (no-buffer) to see events as they arrive. In production, implement reconnection logic with the Last-Event-ID header.
Event types
| Event | Trigger |
|---|
write | A file was created or updated |
delete | A file was deleted |
bulk | A bulk write completed |
import | An import completed |