Dependency awareness
Capture the relationship between context versions, executions and their resulting artifacts.
Explore dependenciesKeep concurrent AI agents consistent as their context evolves. Track dependencies, reject stale results and selectively recompute affected work.
python -m pip install context-coherencev0.1.0 on PyPI · Rust powered · Python native · Framework agnostic
→ All artifacts are coherent
Illustrative lending scenario / simulated executionDependency strategies
Framework adapters
Incremental computation core
Native developer SDK
01 / Context coherence
Agents work with shared and evolving information. A change to an input should not invalidate everything, and an outdated result should not silently become the current one.
Capture the relationship between context versions, executions and their resulting artifacts.
Explore dependenciesValidate the complete captured context before publishing results. Reject work that arrives after its inputs change.
See validationPreserve valid outputs and identify affected work. The host executes only what policy permits.
Explore planningPropagate invalidation through dependent artifacts and identify downstream work that is no longer coherent.
See the architecture02 / How it works
A coherence layer alongside your existing agent runtime, with execution ownership staying in your application.
01 / Capture
Record versioned context and invocation-level or structured dependencies. Conservatively account for runtime-observed context.
02 / Validate
Identify stale artifacts, propagate invalidation and validate arriving results against the captured context.
03 / Plan
Derive dispositions such as reuse, recompute, block or revalidate. The host chooses and executes eligible work.
Explicit dependencies · Versioned artifacts · Conservative defaults
Co2 does not orchestrate agents, schedule work, route requests or execute tools. Plans classify work; they do not authorize external actions.
03 / Incremental execution
When one dependency changes, independent work can remain reusable. Follow the dependency graph to see how a change propagates.
Full recomputation
Artifacts recomputed
Rerun every artifact in this scenario.
Dependency-aware recomputation
Artifacts affected by input 1
20 artifacts remain valid.
Illustrative dependency scenario · Not a performance benchmark
04 / Get started
Install the Python package and try the synthetic coherence example.
python -m venv .venv
. .venv/bin/activate
python -m pip install context-coherence
python -c "from co2 import Coherence; print(Coherence)"Requires CPython 3.11–3.14. Native wheels support Linux x86_64, Linux ARM64 and Apple Silicon macOS. Source builds require Rust/Cargo 1.95+.
from co2 import Coherence, ExecutionKind, IdentityKind, LifecycleConfig, StaleDependencyError
with Coherence(LifecycleConfig.bounded()) as core:
core.register_resource("status", "v1")
attempt, artifact = core.new_identities([IdentityKind.ATTEMPT, IdentityKind.ARTIFACT])
core.begin(attempt.value, "eligibility", resources=["status"],
execution=ExecutionKind.DETERMINISTIC)
core.complete(attempt.value, artifact.value, b"eligible")
late, result = core.new_identities([IdentityKind.ATTEMPT, IdentityKind.ARTIFACT])
core.begin(late.value, "assessment", resources=["status"],
execution=ExecutionKind.DETERMINISTIC)
core.register_resource("status", "v2")
try:
core.complete(late.value, result.value, b"late result")
except StaleDependencyError:
core.abandon(late.value)
print("Stale result rejected")
for step in core.plan_actions().steps:
print(step.computation, step.action.value)Co2 validates publication and plans affected work. Your application runs eligible recomputations.
05 / See it run
A synthetic lending workflow changes status while an agent is working.

Example / lending quickstart
06 / Framework agnostic
Co2 integrates alongside agent frameworks. Your runtime owns execution, tools and routing; Co2 tracks dependency validity and plans.
Framework integrations are available as optional Python extras.