Skip to main content

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"}
  ]
}
total_pages
integer
Total number of pages.
stale_pages
integer
Pages past their review-by date in frontmatter.
orphan_pages
integer
Pages with no incoming backlinks.
Wiki links pointing to nonexistent pages.
empty_pages
integer
Pages with no content beyond frontmatter.
pages_without_frontmatter
integer
Pages missing YAML frontmatter.
Percentage of wiki links that resolve to existing pages.
recently_updated
array
Most recently modified pages.

Analytics overview

Compact dashboard for the web UI engagement panel:
curl 'http://localhost:3333/api/kiwi/analytics/overview'

Page views

curl 'http://localhost:3333/api/kiwi/analytics/views'
curl 'http://localhost:3333/api/kiwi/analytics/views/v2?path=concepts/auth.md'
views/v2 returns richer per-page engagement when tracking is enabled.

Search analytics

curl 'http://localhost:3333/api/kiwi/analytics/searches'
curl 'http://localhost:3333/api/kiwi/analytics/failed-searches'
Failed searches help identify content gaps agents could not answer.
curl 'http://localhost:3333/api/kiwi/analytics/trends'
curl 'http://localhost:3333/api/kiwi/analytics/content-gaps'
Dismiss a content gap suggestion:
curl -X POST 'http://localhost:3333/api/kiwi/analytics/content-gaps/dismiss' \
  -H 'Content-Type: application/json' \
  -d '{"query": "oauth refresh token"}'

Import sources analytics

curl 'http://localhost:3333/api/kiwi/analytics/sources'
Summarizes pages by _source frontmatter from imports.

Per-page health check

Analyze the health of a single page.
path
string
required
File path to check.
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
episodes_prefix
string
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.
GET /api/kiwi/context
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.

Comments

Add, list, resolve, and delete inline comments on pages.

List comments

path
string
required
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"
  }
]

Add a comment

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?"}'

Resolve a comment

curl -X PATCH 'http://localhost:3333/api/kiwi/comments/cmt_01' \
  -H "Content-Type: application/json" \
  -d '{"resolved": true}'

Delete a comment

curl -X DELETE 'http://localhost:3333/api/kiwi/comments/cmt_01'

Sharing

Create and manage share links for pages.
curl -X POST 'http://localhost:3333/api/kiwi/share' \
  -H "Content-Type: application/json" \
  -H "X-Actor: agent:sharer" \
  -d '{"path": "concepts/auth.md", "expiresIn": "168h", "password": "optional-secret"}'
expiresIn is a Go duration string (168h for seven days). Omit it for links that never expire.
{
  "id": "a1b2c3d4",
  "path": "concepts/auth.md",
  "token": "<opaque-token>",
  "expiresAt": "2026-05-09T14:30:00Z",
  "createdBy": "agent:sharer",
  "createdAt": "2026-05-02T14:30:00Z",
  "viewCount": 0
}
Readers open GET /api/kiwi/public/:token (see Utilities).
curl 'http://localhost:3333/api/kiwi/share?path=concepts/auth.md'
path is required — the handler returns every active link for that page.
curl -X DELETE 'http://localhost:3333/api/kiwi/share/a1b2c3d4'
Returns JSON { "revoked": "<id>" } using the share id field (not the long token).

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

EventTrigger
writeA file was created or updated
deleteA file was deleted
bulkA bulk write completed
importAn import completed
Last modified on May 22, 2026