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

# Import and export knowledge with Open Knowledge Format

> Export a Pinecone Nexus context as an Open Knowledge Format (OKF) bundle, or import an OKF bundle from Nexus or another tool into a new context.

> [!NOTE]
>
> This feature is in [early access](https://docs.pinecone.io/release-notes/feature-availability.md). APIs may change, and some features aren't yet available.

Pinecone Nexus can export a context's curated knowledge as an [Open Knowledge Format (OKF)](https://github.com/GoogleCloudPlatform/open-knowledge-format) v0.2 bundle and import a bundle into a new context. OKF is an open format that stores curated knowledge as a folder of Markdown files, one per concept, each with YAML frontmatter. Export a context to review its knowledge in Git or use it in another tool. Import a bundle to query knowledge that's already curated, without curating it again from raw sources.

Both endpoints require `X-Pinecone-Api-Version: unstable`, and successful responses include an `X-Nexus-Experimental: okf` header. The endpoints and the bundle layout can change without a version bump.

## Export a context

### 1. Start the export

Call `POST /contexts/{slug}/okf-exports` with no request body:

```bash curl theme={null}
curl -fsS -X POST "$NEXUS_BASE_URL/contexts/company-knowledge-base/okf-exports" \
  -H "Authorization: Bearer $NEXUS_TOKEN" \
  -H 'X-Pinecone-Api-Version: unstable'
```

The response is `202` with the export's task ID and the path to download the bundle from:

```json Response theme={null}
{
  "task_id": "TASK_ID",
  "bundle_location": "/api/tasks/TASK_ID/task-files/manifests/company-knowledge-base.okf.zip"
}
```

A context runs one export or pack at a time, so a call while one is queued or running returns `409`.

### 2. Wait for the export

Check the task's `state` until it's `completed`:

```bash curl theme={null}
curl -fsS "$NEXUS_BASE_URL/tasks/TASK_ID" \
  -H "Authorization: Bearer $NEXUS_TOKEN" \
  -H 'X-Pinecone-Api-Version: unstable' | jq -r '.state'
```

If the state is `failed` or `cancelled`, the task doesn't write a bundle.

### 3. Download the bundle

Download the file at `bundle_location` on your workspace host:

```bash curl theme={null}
curl -fsS "$NEXUS_BASE_URL/tasks/TASK_ID/task-files/manifests/company-knowledge-base.okf.zip" \
  -H "Authorization: Bearer $NEXUS_TOKEN" \
  -H 'X-Pinecone-Api-Version: unstable' \
  -o company-knowledge-base.okf.zip
```

The download returns `404` until the task completes.

## Import a bundle

An import loads each concept as an artifact unchanged. Nexus doesn't extract artifacts from raw sources again, so an import doesn't spend model calls on extraction.

### 1. Upload the bundle

Call `POST /okf-imports` with the bundle in a multipart `bundle` field:

```bash curl theme={null}
curl -fsS -X POST "$NEXUS_BASE_URL/okf-imports" \
  -H "Authorization: Bearer $NEXUS_TOKEN" \
  -H 'X-Pinecone-Api-Version: unstable' \
  -F "bundle=@company-knowledge.okf.zip"
```

The file name must end in lowercase `.okf.zip`, and the file can be up to 2 GB.

Each import creates a new context named after the file. For example, `company-knowledge.okf.zip` becomes a context named "Company Knowledge" with a slug like `company-knowledge-3f9a`, which ends in a random four-character suffix. Importing the same file again creates a second copy.

The response is `202` with the import's task ID and the new context:

```json Response theme={null}
{
  "task_id": "TASK_ID",
  "context_slug": "company-knowledge-3f9a",
  "context_id": "CONTEXT_ID"
}
```

### 2. Wait for the import

Check the import task's `state` until it's `completed`, then check its `output.state`:

```bash curl theme={null}
curl -fsS "$NEXUS_BASE_URL/tasks/TASK_ID" \
  -H "Authorization: Bearer $NEXUS_TOKEN" \
  -H 'X-Pinecone-Api-Version: unstable' | jq -r '.state, .output.state'
```

A bundle that Nexus can't import still ends with a `state` of `completed`, but its `output.state` is `failed` and `output.error` says why. Nexus keeps the new, empty context, so delete it before you import again.

### 3. Wait for curation

When the import finishes, Nexus starts a curation task on the new context. This task indexes the imported artifacts for search and embeds any raw sources in the bundle, without extracting artifacts again. List the context's curation tasks and wait until the task's `state` is `completed`:

```bash curl theme={null}
curl -fsS "$NEXUS_BASE_URL/tasks?context=company-knowledge-3f9a&workflow=curate" \
  -H "Authorization: Bearer $NEXUS_TOKEN" \
  -H 'X-Pinecone-Api-Version: unstable' | jq -r '.tasks[].state'
```

Then [query the context](https://docs.pinecone.io/guides/nexus/queries.md) like any other. If you add sources and curate later, the imported artifacts stay alongside the ones curation builds. Curation replaces an imported artifact only when it builds one with the same name.

## Bundle format

An exported bundle is a ZIP archive of Markdown concept files. Nexus writes one concept per artifact and keeps its own detail in `nexus_*` frontmatter keys and a `_nexus/` folder. The OKF spec requires tools to accept keys they don't recognize and recommends keeping them, so the bundle stays readable in any OKF tool, and a Nexus import uses that detail to restore the context.

```text Bundle layout theme={null}
company-knowledge-base.okf.zip
├── index.md
├── policy/
│   ├── index.md
│   └── refund-policy.md
├── documents/
│   └── expenses-pdf.md
└── _nexus/
    ├── context.md
    ├── manifest.md
    ├── corpus_groups.md
    └── sources.zip
```

* **Concepts:** Each artifact is a file at `<type>/<name>.md`, in a folder named after its artifact type. Artifacts about a single source document go in `documents/`, and artifact tables go in `tables/`.
* **Indexes:** The root `index.md` sets `okf_version` and links to each folder, and each folder's `index.md` lists its concepts.
* **`_nexus/`:** The context's identity, its [manifest](https://docs.pinecone.io/guides/nexus/context-design.md), its corpus groups, and its raw sources in `sources.zip`.

Each concept file has YAML frontmatter, then the artifact's body, then a `# Relationships` section with a link for each edge:

```markdown policy/refund-policy.md theme={null}
---
type: Policy
title: Refund policy
description: Customers can request a refund within 30 days of purchase.
sources:
- resource: policies/refunds.md
  id: policies-refunds-md
generated:
  by: process:nexus-curate
  at: '2026-11-17T00:42:08+00:00'
nexus_kind: topic
nexus_scope: corpus
nexus_name: Refund policy
nexus_edges:
- type: owned_by
  to_name: Finance team
  to: /team/finance-team.md
---
# Refund policy

Customers can request a refund within 30 days of purchase...

# Relationships

* **owned_by**: [Finance team](../team/finance-team.md)
```

OKF links don't have types, so Nexus writes each edge twice: once as a readable link in the body and once as an entry in `nexus_edges`. The entry also records the edge's type and any evidence or attributes.

### Bundles from other tools

Nexus can also import bundles from other tools. When a bundle has no `_nexus/` folder, Nexus builds a manifest from the concepts, with one artifact type for each distinct `type` and edge types from the relationships between concepts.

A file imports as a concept when it meets these rules:

* It's a `.md` file other than `index.md` or `log.md`.
* It starts with YAML frontmatter between `---` lines.
* Its frontmatter has a non-empty `type`.

Nexus skips files without frontmatter or a `type`. Frontmatter that doesn't parse as YAML key-value pairs fails the whole import, in any `.md` file in the bundle, including `index.md`.

Each concept's name comes from `nexus_name` if it's set, then `title`, then the file name. To import relationships between concepts, add them to `nexus_edges`, or list them under `# Relationships` as `* **<edge type>**: [<target name>](<path>)` bullets. Nexus matches each link to its target by the link text, which must equal the target concept's name, and reads only bullets that start with `*`. If a concept sets `nexus_edges`, Nexus ignores its bullets. A bundle doesn't need raw sources to import.

When you export a context imported from another tool, each concept goes back to its original path and keeps its frontmatter values, with Nexus's `nexus_*` keys added. The bundle's other files, such as `log.md`, are included too.

## Limitations

* Nexus doesn't use OKF's `log.md` or the `status`, `stale_after`, and `verified` fields to curate or answer queries, but an export keeps them.
* An import doesn't index per-document summaries, so search doesn't find them.
