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.0.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.0-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: deepagents_okf_backend-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 26d92b5c718aa76753474449fda7e0d12ee7b6df1eeb07a2e3c5eabba4a51c51
MD5 73a58fda7d3d3688d6fb64b0c19555cc
BLAKE2b-256 02d0accd7d09007719af6f992291fa8d0bbc0f8146abdc869c091f296a9f24e5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for deepagents_okf_backend-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0847c50c90b2453cdc8b81e596b8877025ca4ec3c0e8d1232ccab8981ad4f68b
MD5 fe5c7c7ed02a74c89973486ef9688857
BLAKE2b-256 4b043416cc0fda6762ced8751fb875f269e90a106ab7d944b463a4409eda5bfc

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