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" : []}
Source Config value Description PostgreSQL postgresImport from PostgreSQL queries MySQL mysqlImport from MySQL queries MongoDB mongodbImport from MongoDB collections SQLite sqliteImport from SQLite databases CSV csvImport from CSV files JSON jsonImport from JSON or JSONL files Notion notionImport from Notion workspace Confluence confluenceImport from Confluence spaces Google Docs gdocsImport 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.
Output format: jsonl or csv.
Scope export to a subdirectory (e.g. concepts).
Comma-separated frontmatter fields to include as columns.
Include the full markdown body in the export.
Include outgoing wiki links for each page.
Include vector embeddings (if available).
Maximum number of pages to export.
Export as JSONL
Export as CSV
Export with links and embeddings
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\n OAuth2 + JWT..." , "links" :[ "users" , "billing" ]}
{ "path" : "concepts/billing.md" , "title" : "Billing" , "status" : "draft" , "content" : "# Billing \n\n Stripe 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.