coco-framework
The agent runtime for Coco: LangChain and LangGraph, forked at pinned commits and
renamed to Coco by one script. Agents built on it get Coco's check on every tool
call from ../coco-sdk.
from coco.agents import create_agent
from coco_core.tools import tool
from coco_graph.checkpoint.memory import InMemorySaver
from coco_openai import ChatOpenAI
Install
Install the full framework directly with pip:
pip install . # from a local checkout
pip install -e . # editable development install
pip install "git+https://github.com/coco-ai-au/coco-framework.git"
Or use the coco-sdk environment, which installs every library here:
cd ../coco-sdk && uv sync && source .venv/bin/activate
To work on the fork itself or build and publish the distributions:
python3 scripts/sync_upstream.py --report # rebuild libs/ from the pins, list leftover upstream names
scripts/dev.sh setup # .venv with every library and its test/build tools
scripts/dev.sh test # each library's upstream unit tests, renamed
python3 scripts/build.py --clean # build and verify all 9 trustcoco-* wheels + sdists in dist/
python3 scripts/build.py --include-root # also build the bundled coco-framework distribution
python3 scripts/build.py --publish # upload built distributions with twine/uv
sync_upstream.py needs the upstream clones at the pinned commits in
build_reference/ above this folder (or COCO_UPSTREAM_DIR).
What is here
| Layer | Distribution | Import | From upstream |
|---|---|---|---|
| Core | trustcoco-core |
coco_core |
langchain-core 1.6.5 |
| Graph | trustcoco-graph, -prebuilt, -checkpoint, -checkpoint-sqlite, -checkpoint-postgres |
coco_graph |
langgraph 1.2.12 and its libraries |
| Agents | trustcoco |
coco |
langchain 1.4.2 |
| Models | trustcoco-openai, trustcoco-anthropic |
coco_openai, coco_anthropic |
the two partner packages |
Messages, tools, runnables and prompts; StateGraph, the runtime, interrupt()
and checkpointers; create_agent and its middleware; an OpenAI-compatible and an
Anthropic chat model.
Left out: upstream's hosted-platform clients (langgraph-sdk, the CLI,
RemoteGraph), its tracing client (langsmith, replaced by a local CocoTracer
that sends nothing), text splitters, community integrations and JavaScript.
How the fork is made
scripts/sync_upstream.py copies the pinned upstream libraries into libs/,
renames modules, distributions, classes and environment variables, removes the
hosted-platform paths, copies Coco's own files from overlay/, and applies
patches/. It runs again on every upstream bump, and a bump lands only when the
renamed upstream tests pass. Nobody edits libs/ by hand.
UPSTREAM.md lists the pins, every name mapping, every removed
path, overlay file and patch with its reason, and the test results.
Where Coco attaches
create_agent runs every tool call through wrap_tool_call. CocoGuard from
coco-sdk is that middleware: it runs the call, denies it with a reason, or pauses
the graph with interrupt() until a person decides. The session a contract reads
is the graph's thread id. The framework carries no Coco enforcement code, which
keeps the fork mechanical.
Decisions
| Question | Decided |
|---|---|
| Compatibility with upstream integrations | A clean rename. Upstream partner packages import langchain_core and do not load here; we fork a provider when a design partner needs one |
| Package names | trustcoco-* distributions, coco* imports. PyPI on the day we open source |
| Guard on by default | Yes, once the SDK is stable: create_agent installs CocoGuard in Monitor, with a logged opt out. Not built yet |
| Upstream cadence | Pinned. Bump for a fix we need; review the gap each quarter |
Publishes as wheels to Coco's private package index by scripts/build.py --publish
(or coco-sdk/scripts/publish.sh); the install is in coco-sdk's README. PyPI on the
day we open source.
Licence
MIT. LICENSE keeps "Copyright (c) LangChain, Inc." beside ours, and NOTICE
names what derives from upstream. The Coco name replaces theirs everywhere else.
Metadata
Release files for coco-framework 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| coco_framework-0.1.0.tar.gz | 1.2 MB | Without provenance | Details for coco_framework-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| coco_framework-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for coco_framework-0.1.0-py3-none-any.whl |
Total release size: 2.5 MB
Release files / coco_framework-0.1.0.tar.gz
| Download URL | coco_framework-0.1.0.tar.gz |
|---|---|
| Size | 1.2 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
af6cb1d2e9542e6d397ab4aae6d7e8cb6f0cc5cd98f23c5e8ba8b6644cace9aa
|
|
BLAKE2b-256 checksum How to use checksums |
ed639b01502e41efde1fdfabdd354fe3b3465fc4b52f200abd6a0229030f6bd6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.1
|
Release files / coco_framework-0.1.0-py3-none-any.whl
| Download URL | coco_framework-0.1.0-py3-none-any.whl |
|---|---|
| Size | 1.3 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2fe8c8dd08a9dcd1ea97a0a078328ea446c5137c5e13f079c949da88fa85d054
|
|
BLAKE2b-256 checksum How to use checksums |
20763d6b56e2360b629283919a0dfd79c02ded0538b034b12f5e2a0dcb0dc6e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.1
|
Security for coco-framework 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.