> ## Documentation Index
> Fetch the complete documentation index at: https://docs.basemode.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Ingesting documents

> Getting your own markdown into the graph, the frontmatter that makes it extract well, the difference between filing documents and deriving relationships, and what base can read beyond text.

base reads files. There is no connector to anything, and no API integration to any service, which sounds like a limitation until you notice it means anything you can write to disk as markdown is ingestible.

Two commands do it, and they do different jobs.

## Filing what you already have

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
base sync
base sync --incremental
```

**Why it works.** `base sync` walks the workspace, matches files against the `sync.include` and `sync.exclude` globs in `base.toml`, and extracts frontmatter and body content into the graph as-is. No language model is involved. It is bookkeeping: your documents become nodes you can search.

The defaults are `**/*.md` and `**/paul.json`, with `node_modules/`, `target/`, `.git/` and `.base/` excluded.

**The gotcha.** `--incremental` only re-extracts what changed since the last run. On a large workspace it is the difference between a habit and a chore, and there is no reason not to use it once the first full sync is done.

## Frontmatter that extracts well

Give each file YAML frontmatter with `type`, `status`, `tags` and `relatedTo`:

```yaml theme={"theme":{"light":"github-light","dark":"github-dark"}}
---
type: spec
status: active
tags: [billing, refunds]
relatedTo: [billing-service, payment-provider]
---
```

**Why it works.** Those four fields are what turn a document into a connected node rather than a blob of text with a filename. `relatedTo` in particular becomes edges, which is what lets a search for one thing surface the document about the thing next to it.

**The gotcha.** Files without frontmatter still sync. They just extract badly and connect to nothing, so they only come back on a literal text match.

**Next rung.** You do not have to remember the shape. When you write or edit a `.md` file inside a registered workspace, base injects the contract into that turn, so the agent writing the file is told what good frontmatter looks like as it writes it.

## Deriving relationships instead of filing documents

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
base graph extract --target docs/
base graph extract --target docs/ --model haiku
```

**Why it works.** This is the semantic pass. It runs a model over the corpus and derives concepts and the relationships between them, building structure that was not written down anywhere. `base sync` files what your documents say; `graph extract` works out what they are about.

**The gotcha.** This is the prerequisite for good `base graph query` answers. Querying a graph that has only ever been `sync`ed gives you documents; querying one that has been extracted gives you the connections between them.

**Next rung.** `--model` takes an alias such as `haiku`, `sonnet` or `opus`. A large corpus on the wrong model is the difference between a coffee break and an afternoon.

## Beyond markdown

Markdown only, by default, with no extra dependencies to install.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
base config set multimodal.enabled true
base graph extract --target research/ --multimodal
```

Turn it on permanently with the config key, or force it for one run with the flag.

With it enabled: PDF parsing runs in-process. Image analysis goes through the `claude` binary that is already there. Audio and video go through Whisper, whose dependencies install once with a user-level `pip install` the first time something needs them. Nothing asks for `sudo`.

## Getting data in from somewhere else

There is no native connector to a CRM, a database or an API. The path in is the same for all of them:

1. Export or generate markdown from whatever tooling already talks to that system.
2. Write it into a docs folder inside a registered workspace, with frontmatter.
3. `base sync` to file it, or `base graph extract --target docs/` to derive the relationships.

After that it is ordinary graph content, and `base recall` and `base graph query` reach it like anything else.

**The gotcha.** The live pull happens outside base. That is a real boundary, not an oversight: base takes over once the data is on disk, and stays out of the business of holding credentials for systems it does not own.

## Next

<CardGroup cols={2}>
  <Card title="Querying the graph" icon="magnifying-glass" href="/guides/querying-the-graph">
    Asking the graph an open question, and walking it by hand.
  </Card>

  <Card title="Graph and memory reference" icon="database" href="/reference/graph-and-memory">
    Every `base sync` and `base graph` flag.
  </Card>
</CardGroup>
