Skip to main content
This feature is in early access. 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) 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:
curl
The response is 202 with the export’s task ID and the path to download the bundle from:
Response
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:
curl
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:
curl
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:
curl
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:
Response
2

Wait for the import

Check the import task’s state until it’s completed, then check its output.state:
curl
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:
curl
Then query the context 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.
Bundle layout
  • 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, 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:
policy/refund-policy.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.