OCTX

Open Context

Make context a portable asset.

Package complete Markdown, Chunks, Events, Entities, relations, and vectors into an open, verifiable, portable context Package. Build once and reuse it across compatible knowledge systems and Agents.

OKF compatible Self-contained Vendor-neutral

Reference architecture

One context format connecting knowledge assets to intelligent applications.

OCTX acts as a standardized exchange layer for portable knowledge assets. A knowledge system imports and retrieves them, an Agent injects retrieved results into its runtime context, and people receive knowledge-backed answers.
OPEN CONTEXT / REFERENCE ARCHITECTURE Knowledge flow
04
Interaction layer

People

Ask questions in natural language and receive knowledge-backed answers through an Agent.

OUTCOMEKnowledge and decisions
03
Intelligent application layer

Agent

Searches the knowledge system and writes retrieved results into the active context before answering.

RUNTIMEContext injection
02
Knowledge system layer

Knowledge system

For example, SAG reads OCTX, writes knowledge into a database, and builds retrieval indexes.

SYSTEMImport · index · retrieve
01
Asset and exchange layer

OCTX file

An open context asset carrying Markdown, Chunks, Events, Entities, relations, and optional vectors.

FORMATPackage · validate · distribute

One file, more than one document

Keep knowledge, structure, and evidence together.

An `.octx` file is an immutable complete snapshot. Expanded, it remains a clear, open directory whose contents can be validated individually, not a private database backup.
research-context.octxZIP / ZIP64
manifest.jsonAsset identity · Release · Package Digestsha256:9bd4…e31a
knowledge/Markdown + YAML frontmatter

index.mdconcepts/*.md

data/Portable semantic records

chunks.jsonlevents.jsonlentities.jsonl

relations/Explicit evidence chain

chunk-events.jsonlevent-entities.jsonl

vectors/Optional, rebuildable acceleration

config.json*.arrow

DocumentChunkEventEntity

Why Open Context

Documents move. Extracted context should move with them.

When a document enters a knowledge system, it is chunked, extracted, connected, and embedded. Those expensive results usually exist only inside one database. When the file leaves the system, its structure disappears.

Open Context turns those results into independent assets. Producers can publish them; recipients can inspect, install, upgrade, and trace them; and Agents can use the normal retrieval path immediately.

Boundary of the open standard

Preserve knowledge itself. Hide implementation details.

Readable by people and Agents

OCTX uses OKF-compatible Markdown. It can be opened, reviewed, and versioned without a specialized SDK.

Stable identity, exact content

UUIDv7 preserves object identity, Package Digest fixes exact content, and Release carries version evolution.

Structure travels with knowledge

Chunks, Events, Entities, relations, and vectors can travel with the Package instead of being extracted again in every system.

Reusable and rebuildable

Vectors and local indexes are acceleration layers. Reuse compatible data and rebuild incompatible data from trusted upstream records.

From creation to retrieval

One Package connects producers and consumers.

Markdown / OKF Create .octx Validate Import / Index Retrieve

Start building

Create, open, validate, then import.

The standalone octx package creates, opens, and validates Packages. Using SAG as an example, zleap-sag can import .octx files into a retrieval system and export system context back to .octx.
01Create and validateStandalone octx package
python
from octx import create_octx, open_octx, validate_octx

release = create_octx(
    source="./knowledge",
    workspace="./my-context",
    name="SAG Technical Research",
    output="research-context.octx",
)

with open_octx("research-context.octx") as package:
    report = validate_octx(package)
    assert report.valid
02Import OCTXzleap-sag adapter
python
from zleap_sag import import_octx

installation = import_octx("research-context.octx")

# Documents are available immediately.
# Missing local indexes continue in the background.
print(installation.status)  # installed | indexing | ready

Progressive adoption

From readable documents to complete import-ready context.

LayerMarkdownStable identity / ReleaseChunk / Event / EntityVectorsUse
OKF BundleReadable by people and Agents
OCTXOptionalOptionalPortable and verifiable
SAG-StructuredComplete, with no orphaned recordsOptionalDirect structured import

OPEN BY DESIGN

Context should not be locked inside a database.

Start with Open Context v0.1 and create your first portable context asset.
Read the specification