> ## 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.

# Data import

> Turn rows, records, and documents from 21 sources into markdown pages with frontmatter.

Every imported record becomes one markdown page. Fields land in frontmatter, so you can search, filter, and query them with [DQL](https://docs.kiwifs.com/concepts/dql.md) right away. Imports go through the normal write pipeline, so each page is versioned and indexed like any other edit.

```bash Terminal theme={null}
kiwifs import --from <source> [flags] --root ./knowledge
```

## Supported sources

> [card] [Databases](https://docs.kiwifs.com/import/databases.md)
>
> `postgres`, `mysql`, `sqlite`, `mongodb`, `firestore`, `dynamodb`, `redis`, `elasticsearch`

> [card] [Files](https://docs.kiwifs.com/import/files.md)
>
> `csv`, `json`, `jsonl`, `yaml`, `excel`, `bibtex`, `markdown`

> [card] [Apps and wikis](https://docs.kiwifs.com/import/saas.md)
>
> `notion`, `airtable`, `gsheets`, `obsidian`, `confluence`

> [card] [Croissant](https://docs.kiwifs.com/import/croissant.md)
>
> `croissant` dataset metadata from Kaggle, Hugging Face, and others

> [card] [Airbyte](https://docs.kiwifs.com/import/airbyte.md)
>
> Airbyte connectors through Docker or Airbyte Cloud

> [card] [Documents](https://docs.kiwifs.com/import/connections.md#ingest-documents)
>
> PDF, DOCX, PPTX, and more through MarkItDown

## Where each source is available

The CLI supports every source. The REST API, the web UI import wizard, and the `kiwi_import` MCP tool support a subset.

| Source | CLI | REST `POST /import` | MCP `kiwi_import` |
| - | - | - | - |
| `postgres`, `mysql`, `sqlite`, `mongodb`, `firestore` | Yes | Yes | Yes |
| `csv`, `json`, `jsonl` | Yes | Yes | Yes |
| `notion`, `airtable` | Yes | Yes | Yes |
| `markdown`, `obsidian`, `bibtex`, `croissant` | Yes | Yes | No |
| `yaml`, `excel`, `gsheets`, `confluence` | Yes | No | No |
| `dynamodb`, `redis`, `elasticsearch` | Yes | No | No |
| Airbyte connectors (`firebase-rtdb`, ...) | No | Yes | No |

> [!NOTE]
>
> REST and MCP imports read file and directory paths on the machine that runs KiwiFS, not on the caller's machine. To send a file from your machine, use `POST /api/kiwi/import/upload`. The `kiwi_import` MCP tool only works in local mode (`kiwifs mcp --root`).

## Common flags

These flags work with every source.

| Flag | Default | Description |
| - | - | - |
| `--from` | | Source type (required) |
| `--root`, `-r` | `./knowledge` | Knowledge root to write into |
| `--prefix` | Source name | Folder for the imported pages |
| `--id-column` | Auto-detect | Field whose value becomes the file name |
| `--columns` | All | Comma-separated fields to keep |
| `--limit` | `0` (no limit) | Maximum records to import |
| `--dry-run` | `false` | Count what would be imported without writing |

The default `--prefix` is the source's name: the table or collection, the file name without its extension, the vault folder name, `notion`, or `redis`.

## How records become pages

KiwiFS writes each record to `<prefix>/<id>.md`. The `<id>` is the `--id-column` value, the table's primary key, or an `id` or `_id` field. Without any of those it falls back to the row number.

```markdown users/42.md theme={null}
---
_imported_at: "2026-10-19T18:46:15Z"
_source: users
_source_id: pg:users:42
email: jane@example.com
name: Jane Doe
role: admin
---

# Jane Doe

| Field | Value |
|-------|-------|
| email | jane@example.com |
| name | Jane Doe |
| role | admin |
```

The page title comes from a `title` or `name` field, falling back to the ID. Sources that already produce markdown (`markdown`, `obsidian`, `confluence`, `bibtex`, `croissant`) keep their own body and frontmatter. KiwiFS adds the `_source`, `_source_id`, and `_imported_at` fields to it.

### Re-imports

Imports are idempotent. When a page with the same `_source_id` exists and its fields are unchanged, KiwiFS skips it. Changed records are rewritten, and new records are created.

```text Output theme={null}
Imported 12 records, skipped 40
```

## Generate a schema from a sample

For `csv`, `json`, and `jsonl` files, `--infer-schema` samples up to 100 rows and prints a JSON Schema instead of importing. Add `--save-schema` to also write it to `.kiwi/schemas/<name>.json` under the current directory.

```bash Terminal theme={null}
kiwifs import --from csv --file people.csv --infer-schema --save-schema
```

See [Schemas](https://docs.kiwifs.com/concepts/schemas.md) for how KiwiFS validates frontmatter against these files.

## Related

> [card] [Browse, preview, and sync](https://docs.kiwifs.com/import/connections.md)
>
> Preview rows, save connections, and schedule auto-sync.

> [card] [Import API](https://docs.kiwifs.com/api/import-export.md)
>
> REST reference for every import endpoint.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.