> For the complete documentation index, see [llms.txt](https://docs.origintrail.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.origintrail.io/use-dkg/okf.md).

# OKF Import, Export, and Verify

`dkg okf` maps Google Open Knowledge Format bundles into named per-concept Knowledge Assets. Import uses the normal lifecycle: create, write, finalize, optional share. It never publishes directly to Verifiable Memory.

```mermaid
flowchart LR
  Bundle["OKF bundle"] --> RDF["deterministic RDF"]
  RDF --> KA["per-concept Knowledge Assets"]
  KA --> WM["Working Memory"]
  WM --> SWM["optional --share to SWM"]
  SWM --> VM["explicit dkg ka publish or publish-async"]
```

## Import

```bash
dkg okf import ./bundle --context-graph-id okf-demo --create-context-graph
dkg okf import ./bundle --context-graph-id okf-demo --share
dkg okf import ./bundle --context-graph-id private-okf --private --create-context-graph
```

Important flags:

| Flag                           | Meaning                                                         |
| ------------------------------ | --------------------------------------------------------------- |
| `--context-graph-id <id>`      | Target context graph                                            |
| `--create-context-graph`       | Create the context graph if needed                              |
| `--share`                      | Share imported per-concept KAs to SWM after WM import/finalize  |
| `--replace`                    | Replace existing imported concept assets                        |
| `--manifest <path>`            | Resume or inspect staged import progress from a custom manifest |
| `--private`                    | Create/use a private context graph for imports                  |
| `--sub-graph-name <name>`      | Import into a registered sub-graph                              |
| `--relate <predicate>`         | Override relation mapping for concept links                     |
| `--dry-run` / `--print-nquads` | Validate and print deterministic RDF without mutating the node  |

Private allowlisting currently uses the OKF command's implemented flags. The broader product decision about exposing `--allowed-agent` alongside or instead of `--allowed-peer` remains open.

## Export

```bash
dkg okf export okf-demo ./out
dkg okf export okf-demo ./out --view shared-working-memory
dkg okf export okf-demo ./out --view verifiable-memory
```

Export reads a context graph view and writes an OKF bundle to the output directory. Use export views to choose Working Memory, Shared Working Memory, or Verifiable Memory.

## Verify

```bash
dkg okf verify ./bundle --context-graph-id okf-demo
dkg okf verify ./bundle --context-graph-id okf-demo --list-missing
```

Verify compares the deterministic RDF expected from the local OKF bundle with triples currently visible from the node. Current verify behavior is SWM-oriented; sub-graph scoped verify is a known follow-up gap.

## VM Capstone

After an OKF import has been shared to SWM, publish selected named KAs explicitly:

```bash
dkg ka publish-async <concept-ka-name> --context-graph-id okf-demo
```

There is no OKF import-and-publish one-shot.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.origintrail.io/use-dkg/okf.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
