Open Agent Context Standard draft reference implementation for governed agent memory and context
Project description
OACS v0.1 draft - Open Agent Context Standard
EN
OACS is an open lower-layer draft contract for agent memory and context:
MemoryRecord, ContextCapsule, CapabilityGrant, EvidenceRef, auditable
memory_calls, and adapter boundaries. The bundled acs CLI is the reference
local interface to that contract.
OACS is not a replacement for MCP. MCP describes tool/server interoperability. OACS describes how an agent assembles and governs context before a model or MCP tool is used.
It is also not an agent framework, model backend, vector database, or benchmark harness. Those systems can sit above or beside OACS and call its memory, context, capability, and audit operations.
Standard Draft vs Reference Implementation
- OACS v0.1 draft spec: terminology, lifecycle, capsule format, security
model, and JSON contracts in
docs/andschemas/. - Python reference implementation: local
oacspackage,acsCLI, FastAPI API, SQLite backend, encryption layer, registries, memory loop, and validation adapters. Storage goes through a thinStorageBackendprotocol; SQLite is the bundled reference backend.
The draft can change before v1.0. See docs/COMPATIBILITY.md for breaking
change policy.
Core Contracts
The core draft is intentionally small:
MemoryRecord: lifecycle, depth, scope, encrypted content, and evidence.ContextCapsule: portable governed context for one task.CapabilityGrant: actor-scoped permission record.EvidenceRefand structured evidence items: support for memory and context decisions.MemoryOperation,ContextOperation,MemoryLoopRun, andmemory_call: auditable operation envelopes.
Benchmarks, LM Studio, MCP execution, repo dogfood, and task packs are reference adapters. They validate or exercise the contract but do not expand it.
Quickstart
This path reaches the first useful OACS result: commit a memory, retrieve it, and build an explainable Context Capsule.
For the public PyPI install path, see docs/QUICKSTART_PYPI.md.
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev,crypto]"
export OACS_DB=./.oacs/oacs.db
export OACS_PASSPHRASE="<choose-a-local-dev-passphrase>"
acs init --json
acs key init --passphrase "$OACS_PASSPHRASE" --json
acs actor create --type human --name "User" --json
CANDIDATE_ID=$(acs memory propose --type procedure --depth 2 --scope project \
--text "In project Alpha reports are generated with make report-safe." --json \
| python3 -c 'import json,sys; print(json.load(sys.stdin)["id"])')
acs memory commit "$CANDIDATE_ID" --json
acs memory query --query "Alpha report" --scope project --json
acs context build --intent answer_project_question --scope project --budget 4000 --json
Expected result: memory query returns the committed procedure and
context build returns a ctx_... capsule with that memory included.
Validation Adapters
acs benchmark generate --suite memory_critical --count 20 --json
acs benchmark run --mode baseline_no_memory --json
acs benchmark run --mode oacs_memory_call_loop --json
acs benchmark compare --json
Benchmarks are validation fixtures for the memory/context contract, not the
purpose of OACS. oacs_memory_call_loop records deterministic OACS
memory_calls such as memory.query and memory.extract_evidence; benchmark
scoring stays in the benchmark adapter. Task pack import/download is schema and
checksum validated; downloads require explicit --allow-network.
oacs_memory_call_loop is the preferred execution path for benchmark and
product validation. oacs_memory_loop remains a broad Context Capsule
compatibility mode.
Current technical reports:
examples/benchmarks/memory_calls_gemma_e2b_2026-05-01.mdexamples/benchmarks/full_context_gemma_e2b_2026-05-02.mdexamples/benchmarks/community_memory_gemma_e2b_2026-05-02.md
Killer Demo
The local killer demo proves the public product story without a hosted service,
network access, LM Studio, or a running model. It writes one scoped memory,
builds and exports a Context Capsule, validates the export envelope, records
memory_calls, imports MCP metadata as an adapter boundary, verifies the audit
chain, and links the checked-in full-context benchmark comparison.
python3 examples/killer_demo/run_demo.py --out .oacs/killer-demo --force
Raw artifacts are written to the output directory; start with SUMMARY.md and
summary.json.
Tool onboarding is documented in docs/TOOL_BINDINGS.md.
Development Dogfood
Optional source-checkout dogfood lives in the removable
repo_development_memory skill under examples/skills/. It is not part of the
standard surface or the minimal installed-package path:
acs skill scan examples/skills --json
acs skill run repo_development_memory \
--payload '{"action":"capture","task":"tighten memory_calls","summary":"Removed benchmark-specific shortcuts and kept selector metadata typed.","cwd":"."}' --json
acs skill run repo_development_memory \
--payload '{"action":"context","task":"continue OACS development","cwd":"."}' --json
The dogfood skill is a source-checkout adapter. Auto mode commits only D1 repo episodes; D2/D3 memory remains explicit review.
LM Studio
Start LM Studio with an OpenAI-compatible server at http://localhost:1234/v1.
The model name is configurable:
export OACS_LMSTUDIO_BASE_URL=http://localhost:1234/v1
export OACS_LMSTUDIO_MODEL=gemma-4-e2b
acs benchmark run --mode oacs_memory_call_loop --provider lmstudio --model "$OACS_LMSTUDIO_MODEL" --json
Unit tests do not require LM Studio; integration tests skip when the server is unavailable.
Build Pipeline
GitHub Actions runs lint, typecheck, tests, package build, wheel install, and
CLI smoke checks. Public prerelease publishing uses trusted publishing and the
checklist in docs/RELEASE.md; see docs/BUILD.md for local build parity.
Security Model
Memory and sensitive capsule payloads are encrypted before they are written to SQLite. The default provider is passphrase-based envelope encryption. PQC is a key-wrapping integration point only; no fake post-quantum claims are made when optional PQ libraries are absent.
Limitations
This is a local POC, not a hosted multi-tenant system. MCP execution is modeled
through typed bindings and imported tool metadata, with optional stdio execution
guarded by tool.call capabilities. Retrieval is pluggable, but deterministic
lexical/structured retrieval is the baseline. Embeddings are optional adapters,
not a core requirement. Tiny tasks can show OACS overhead; medium and long
memory tasks are the current strength.
RU
OACS - open lower-layer draft contract для агентской памяти и контекста:
MemoryRecord, ContextCapsule, CapabilityGrant, EvidenceRef, auditable
memory_calls и adapter boundaries. Встроенный CLI acs является reference
local interface к этому contract.
OACS не заменяет MCP. MCP описывает совместимость tools/server. OACS описывает, как агент собирает и контролирует контекст до вызова модели или MCP tool.
Также это не agent framework, model backend, vector database или benchmark harness. Такие системы могут находиться выше или рядом с OACS и вызывать его memory, context, capability и audit operations.
Draft стандарта и reference implementation
- OACS v0.1 draft spec: терминология, lifecycle, формат capsule, security
model и JSON contracts в
docs/иschemas/. - Python reference implementation: локальный пакет
oacs, CLIacs, FastAPI API, SQLite backend, encryption layer, registries, memory loop и validation adapters. Storage идёт через тонкийStorageBackendprotocol; SQLite является bundled reference backend.
До v1.0 draft может меняться. Compatibility policy описана в
docs/COMPATIBILITY.md.
Core Contracts
Core draft намеренно небольшой:
MemoryRecord: lifecycle, depth, scope, encrypted content и evidence.ContextCapsule: переносимый управляемый контекст для одной задачи.CapabilityGrant: actor-scoped permission record.EvidenceRefи structured evidence items: поддержка memory/context decisions.MemoryOperation,ContextOperation,MemoryLoopRunиmemory_call: auditable operation envelopes.
Benchmarks, LM Studio, MCP execution, repo dogfood и task packs являются reference adapters. Они валидируют или упражняют contract, но не расширяют его.
Quickstart
Этот путь даёт первый полезный результат OACS: записать memory, найти её и построить explainable Context Capsule.
Публичный путь установки через PyPI описан в docs/QUICKSTART_PYPI.md.
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev,crypto]"
export OACS_DB=./.oacs/oacs.db
export OACS_PASSPHRASE="<choose-a-local-dev-passphrase>"
acs init --json
acs key init --passphrase "$OACS_PASSPHRASE" --json
acs actor create --type human --name "User" --json
CANDIDATE_ID=$(acs memory propose --type procedure --depth 2 --scope project \
--text "В проекте Alpha отчёты генерируются через make report-safe." --json \
| python3 -c 'import json,sys; print(json.load(sys.stdin)["id"])')
acs memory commit "$CANDIDATE_ID" --json
acs memory query --query "Alpha отчёты" --scope project --json
acs context build --intent answer_project_question --scope project --budget 4000 --json
Ожидаемый результат: memory query возвращает committed procedure, а
context build возвращает capsule ctx_... с этой memory внутри.
Validation adapters
acs benchmark generate --suite memory_critical --count 20 --json
acs benchmark run --mode baseline_no_memory --json
acs benchmark run --mode oacs_memory_call_loop --json
acs benchmark compare --json
Benchmarks - это validation fixtures для memory/context contract, а не цель
OACS. oacs_memory_call_loop записывает deterministic OACS memory_calls,
например memory.query и memory.extract_evidence; scoring остаётся в
benchmark adapter. Import/download task packs валидируется по schema и
checksum; downloads требуют явный --allow-network.
oacs_memory_call_loop - preferred execution path для benchmark и product
validation. oacs_memory_loop остаётся broad Context Capsule compatibility
mode.
Текущие technical reports:
examples/benchmarks/memory_calls_gemma_e2b_2026-05-01.mdexamples/benchmarks/full_context_gemma_e2b_2026-05-02.mdexamples/benchmarks/community_memory_gemma_e2b_2026-05-02.md
Killer Demo
Локальное killer demo доказывает публичный product story без hosted service,
network access, LM Studio или запущенной модели. Оно пишет одну scoped memory,
строит и экспортирует Context Capsule, валидирует export envelope, записывает
memory_calls, импортирует MCP metadata как adapter boundary, проверяет audit
chain и ссылается на checked-in full-context benchmark comparison.
python3 examples/killer_demo/run_demo.py --out .oacs/killer-demo --force
Raw artifacts пишутся в output directory; начинать стоит с SUMMARY.md и
summary.json.
Tool onboarding описан в docs/TOOL_BINDINGS.md.
Development dogfood
Optional source-checkout dogfood живёт в отключаемом
repo_development_memory skill в examples/skills/. Это не часть standard
surface и не minimal installed-package path:
acs skill scan examples/skills --json
acs skill run repo_development_memory \
--payload '{"action":"capture","task":"tighten memory_calls","summary":"Removed benchmark-specific shortcuts and kept selector metadata typed.","cwd":"."}' --json
acs skill run repo_development_memory \
--payload '{"action":"context","task":"continue OACS development","cwd":"."}' --json
Dogfood skill является source-checkout adapter. Auto mode коммитит только D1 repo episodes; D2/D3 memory остаётся под явным review.
LM Studio
Запустите LM Studio с OpenAI-compatible server на http://localhost:1234/v1.
Модель настраивается:
export OACS_LMSTUDIO_BASE_URL=http://localhost:1234/v1
export OACS_LMSTUDIO_MODEL=gemma-4-e2b
acs benchmark run --mode oacs_memory_call_loop --provider lmstudio --model "$OACS_LMSTUDIO_MODEL" --json
Unit tests не требуют LM Studio; integration tests пропускаются, если server недоступен.
Сборочная линия
GitHub Actions запускает lint, typecheck, tests, package build, wheel install и
CLI smoke checks. Публичные prerelease публикации используют trusted publishing
и checklist в docs/RELEASE.md; локальный build parity описан в
docs/BUILD.md.
Security model
Memory и sensitive capsule payloads шифруются до записи в SQLite. Default provider использует passphrase-based envelope encryption. PQC - только integration point для key wrapping; если optional PQ libraries отсутствуют, проект не делает fake post-quantum claims.
Ограничения
Это локальный POC, не hosted multi-tenant service. MCP execution представлен
typed bindings и импортированной metadata, а optional stdio execution защищён
tool.call capabilities. Retrieval расширяемый, но baseline - deterministic
lexical/structured retrieval. Embeddings являются optional adapters, а не core
requirement. Tiny tasks могут показывать OACS overhead; medium и long memory
tasks сейчас являются сильной стороной.
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 oacs-0.3.1a1.tar.gz.
File metadata
- Download URL: oacs-0.3.1a1.tar.gz
- Upload date:
- Size: 113.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd8606f5b1d8229aedbc03da0c9cd02482163e41f0e93a550f5adc7a73ca4ca3
|
|
| MD5 |
1928c4978da67436f66fc4c78eb1a6d5
|
|
| BLAKE2b-256 |
2f148d1ea4e7d4581ff469e63aa8a7e96b62dc7b8f1f4096ae983788b19c051b
|
Provenance
The following attestation bundles were made for oacs-0.3.1a1.tar.gz:
Publisher:
release.yml on mussolene/open-agent-context
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
oacs-0.3.1a1.tar.gz -
Subject digest:
dd8606f5b1d8229aedbc03da0c9cd02482163e41f0e93a550f5adc7a73ca4ca3 - Sigstore transparency entry: 1429097815
- Sigstore integration time:
-
Permalink:
mussolene/open-agent-context@22464afcac741221a3e529ba3983926b7136f365 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/mussolene
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@22464afcac741221a3e529ba3983926b7136f365 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file oacs-0.3.1a1-py3-none-any.whl.
File metadata
- Download URL: oacs-0.3.1a1-py3-none-any.whl
- Upload date:
- Size: 91.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fbcb4a4a4feb069ec5e682a8d9053fbd32775672a4da69c40248c6cd620625e7
|
|
| MD5 |
f35954d8cba33e0cfe41654805c6a649
|
|
| BLAKE2b-256 |
4377ae6c88063804f94e5eb5b34bf2bd155c490edf922081d71f4c38d35aa8f9
|
Provenance
The following attestation bundles were made for oacs-0.3.1a1-py3-none-any.whl:
Publisher:
release.yml on mussolene/open-agent-context
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
oacs-0.3.1a1-py3-none-any.whl -
Subject digest:
fbcb4a4a4feb069ec5e682a8d9053fbd32775672a4da69c40248c6cd620625e7 - Sigstore transparency entry: 1429097831
- Sigstore integration time:
-
Permalink:
mussolene/open-agent-context@22464afcac741221a3e529ba3983926b7136f365 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/mussolene
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@22464afcac741221a3e529ba3983926b7136f365 -
Trigger Event:
workflow_dispatch
-
Statement type: