Skip to main content

OKF-aware virtual filesystem backend for LangChain Deep Agents (Open Knowledge Format).

Project description

deepagents-okf-backend

CI PyPI Python License: MIT Ruff

An OKF-aware virtual filesystem backend for LangChain Deep Agents.

It mounts an Open Knowledge Format (OKF) bundle — "a directory of markdown files with YAML frontmatter" — as the agent's filesystem, so a deep agent can read, search, and curate organizational knowledge while every write stays a valid OKF document.

🧩 Community backend (not maintained by LangChain), built for the integrations/backends list.

Why

A deep agent's knowledge memory is usually either ephemeral (StateBackend) or closed (ContextHubBackend → LangSmith Hub). OKF is the open, vendor-neutral alternative: git-versionable markdown, human-readable, parseable by any agent or framework.

StateBackend StoreBackend FilesystemBackend OKFBackend
Persists across threads
Human-readable on disk
Vendor-neutral / portable bundle
Structured frontmatter query
Validates writes as a shareable format

What OKFBackend adds:

  • Open knowledge, no lock-in — portable markdown bundles, not a proprietary store.
  • Semantic, not blind — query by type / tags / title, not just grep.
  • Self-improving wiki — the agent maintains the bundle; writes are validated as OKF.
  • Cross-agent sharing"a bundle synthesized by one LLM can be queried by another."
  • Sync + async, path-sandboxed to the bundle root, fully typed (py.typed).

Install

pip install deepagents-okf-backend

Quickstart

from deepagents import create_deep_agent
from deepagents_okf_backend import OKFBackend

backend = OKFBackend("./knowledge", validate=True, auto_timestamp=True)

agent = create_deep_agent(
    tools=[],
    instructions="You curate the organization's OKF knowledge bundle.",
    backend=backend,
)

Knowledge surface + scratch space (CompositeBackend)

Mount the OKF bundle on /knowledge and keep an ephemeral scratch filesystem on /:

from deepagents.backends import CompositeBackend, StateBackend
from deepagents_okf_backend import OKFBackend

backend = CompositeBackend(
    routes={"/knowledge": OKFBackend("./knowledge")},
    default=StateBackend(),
)

Structured query tool

The six standard filesystem tools only grep raw text. Give the agent a typed lookup over OKF frontmatter:

from deepagents import create_deep_agent
from deepagents_okf_backend import OKFBackend, make_okf_query_tool

backend = OKFBackend("./knowledge")
agent = create_deep_agent(
    tools=[make_okf_query_tool(backend)],   # okf_query(type=..., tags=..., title_contains=...)
    instructions="Use okf_query to find tables and metrics before answering.",
    backend=backend,
)

You can also call it directly:

from deepagents_okf_backend import query_bundle

hits = query_bundle(backend, type="Metric", tags=["growth"])

What is OKF?

Open Knowledge Format (Google Cloud, 2026) represents knowledge as a directory of markdown files with YAML frontmatter. The only required field is type; title, description, resource, tags, and timestamp are optional. See the announcement.

---
type: BigQuery Table
title: Orders
description: One row per completed customer order.
tags: [sales, revenue]
---
# Schema
| Column | Type | Description |
|--------|------|-------------|
| `order_id` | STRING | Globally unique order identifier. |

Development

See DEVELOPMENT_PLAN.md. Contributions welcome — see CONTRIBUTING.md.

pip install -e ".[dev]"
ruff check . && mypy src && pytest --cov=deepagents_okf_backend

License

MIT © Emanuele Ielo

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deepagents_okf_backend-0.1.1.tar.gz (19.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

deepagents_okf_backend-0.1.1-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file deepagents_okf_backend-0.1.1.tar.gz.

File metadata

  • Download URL: deepagents_okf_backend-0.1.1.tar.gz
  • Upload date:
  • Size: 19.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for deepagents_okf_backend-0.1.1.tar.gz
Algorithm Hash digest
SHA256 fafde46d404e6cceaa0b4a4208386d255f7d5afd9f8f922cb3160f8788677cc6
MD5 f14216cf768ea4781feb077590f96e4c
BLAKE2b-256 9695a30a69bf8e0beb130e763c1dcadac22b1a3ee552341ef1c56940859f002b

See more details on using hashes here.

File details

Details for the file deepagents_okf_backend-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for deepagents_okf_backend-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a04b901b01b33396ef7a685aee39c4e98eca205b40937d76eb744468e27215c7
MD5 69ce51a2bb12abb03abc20cbcced46b1
BLAKE2b-256 e15a76f5fc5eb5319b21854f232984d39a2824d2f39840f961e7b145a9419098

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page