This feature is in early access. APIs may change, and some features aren’t yet available.
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
Start the export
Call The response is A context runs one export or pack at a time, so a call while one is queued or running returns
POST /contexts/{slug}/okf-exports with no request body:curl
202 with the export’s task ID and the path to download the bundle from:Response
409.Wait for the export
Check the task’s If the state is
state until it’s completed:curl
failed or cancelled, the task doesn’t write a bundle.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.Upload the bundle
Call The file name must end in lowercase
POST /okf-imports with the bundle in a multipart bundle field:curl
.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
Wait for the import
Check the import task’s A bundle that Nexus can’t import still ends with a
state until it’s completed, then check its output.state:curl
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.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 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.
state is completed:curl
Bundle format
An exported bundle is a ZIP archive of Markdown concept files. Nexus writes one concept per artifact and keeps its own detail innexus_* 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 indocuments/, and artifact tables go intables/. - Indexes: The root
index.mdsetsokf_versionand links to each folder, and each folder’sindex.mdlists its concepts. _nexus/: The context’s identity, its manifest, its corpus groups, and its raw sources insources.zip.
# Relationships section with a link for each edge:
policy/refund-policy.md
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
.mdfile other thanindex.mdorlog.md. - It starts with YAML frontmatter between
---lines. - Its frontmatter has a non-empty
type.
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.mdor thestatus,stale_after, andverifiedfields to curate or answer queries, but an export keeps them. - An import doesn’t index per-document summaries, so search doesn’t find them.