OKF-aware virtual filesystem backend for LangChain Deep Agents (Open Knowledge Format).
Project description
deepagents-okf-backend
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/backendslist.
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 justgrep. - 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26d92b5c718aa76753474449fda7e0d12ee7b6df1eeb07a2e3c5eabba4a51c51
|
|
| MD5 |
73a58fda7d3d3688d6fb64b0c19555cc
|
|
| BLAKE2b-256 |
02d0accd7d09007719af6f992291fa8d0bbc0f8146abdc869c091f296a9f24e5
|
File details
Details for the file deepagents_okf_backend-0.1.0-py3-none-any.whl.
File metadata
- Download URL: deepagents_okf_backend-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0847c50c90b2453cdc8b81e596b8877025ca4ec3c0e8d1232ccab8981ad4f68b
|
|
| MD5 |
fe5c7c7ed02a74c89973486ef9688857
|
|
| BLAKE2b-256 |
4b043416cc0fda6762ced8751fb875f269e90a106ab7d944b463a4409eda5bfc
|