Skip to main content

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.

Import

Bulk import data into your knowledge base. The import endpoint accepts the same source configuration options as the kiwifs import CLI command.
curl -X POST 'http://localhost:3333/api/kiwi/import' \
  -H "Content-Type: application/json" \
  -H "X-Actor: agent:importer" \
  -d '{
    "source": "postgres",
    "connection": "postgres://user:pass@localhost:5432/mydb",
    "query": "SELECT id, title, body FROM articles WHERE updated_at > '\''2026-01-01'\''",
    "mapping": {
      "path": "articles/{{id}}.md",
      "title": "{{title}}",
      "content": "{{body}}"
    }
  }'
{"imported": 42, "skipped": 0, "errors": []}
SourceConfig valueDescription
PostgreSQLpostgresImport from PostgreSQL queries
MySQLmysqlImport from MySQL queries
MongoDBmongodbImport from MongoDB collections
SQLitesqliteImport from SQLite databases
CSVcsvImport from CSV files
JSONjsonImport from JSON or JSONL files
NotionnotionImport from Notion workspace
ConfluenceconfluenceImport from Confluence spaces
Google DocsgdocsImport from Google Docs
Use double-brace templates to map source fields to KiwiFS file paths and frontmatter:
{
  "path": "concepts/{{slug}}.md",
  "title": "{{name}}",
  "content": "{{body}}",
  "frontmatter": {
    "source": "postgres",
    "source_id": "{{id}}",
    "status": "draft"
  }
}
Large imports can take time. The endpoint responds synchronously. For very large datasets, consider using the CLI kiwifs import command with progress output.

Export

Export your knowledge base in structured formats.
format
string
required
Output format: jsonl or csv.
path
string
Scope export to a subdirectory (e.g. concepts).
columns
string
Comma-separated frontmatter fields to include as columns.
include-content
boolean
default:"false"
Include the full markdown body in the export.
Include outgoing wiki links for each page.
include-embeddings
boolean
default:"false"
Include vector embeddings (if available).
limit
integer
Maximum number of pages to export.
curl 'http://localhost:3333/api/kiwi/export?format=jsonl&path=concepts&include-content=true'

JSONL output

Each line is a JSON object representing one page:
{"path":"concepts/auth.md","title":"Authentication","status":"verified","content":"# Authentication\n\nOAuth2 + JWT...","links":["users","billing"]}
{"path":"concepts/billing.md","title":"Billing","status":"draft","content":"# Billing\n\nStripe integration...","links":["users"]}

CSV output

path,title,status,updated
concepts/auth.md,Authentication,verified,2026-04-25
concepts/billing.md,Billing,draft,2026-04-20
Use JSONL export with include-content=true to create backups or to feed your knowledge base into external pipelines.
Last modified on May 4, 2026