LangChain integration for the Colber platform — callbacks, memory, and a 6-service toolkit.
Project description
colber-langchain
LangChain integration for the Colber platform — observability callbacks, semantic memory backed by colber-memory, and a 6-service toolkit. Apache-2.0.
This is the first public plugin in the "Lego" GTM lever. It depends only on langchain-core (not the full langchain package) and the published colber-sdk PyPI release, so it stays lightweight and is independently versionable.
Install
pip install colber-langchain
For local development inside the Colber monorepo:
pip install -e apps/colber-langchain
Components
ColberCallbackHandler
Captures LangChain run events as Colber observability spans + structured logs. Attach to any chain / agent via the standard callbacks=[...] argument.
from colber_langchain import ColberCallbackHandler
callback = ColberCallbackHandler(
agent_did="did:key:z6Mk...",
operator_id="op-demo",
service_name="my-langchain-agent",
)
# Then plug into any LangChain runnable:
result = my_chain.invoke({"input": "hello"}, config={"callbacks": [callback]})
Hooks covered: on_chain_start/end/error, on_llm_start/end/error, on_chat_model_start, on_tool_start/end/error, on_agent_action, on_agent_finish. Each hook produces a span; *_error hooks also emit a structured log. Trace correlation follows LangChain's parent_run_id so every nested step lives under a single trace id.
Network failures to the observability service are caught and logged at WARN; the chain is never aborted because the backend is sick.
ColberMemory
Backs LangChain's BaseMemory with the colber-memory service (Qdrant + ACL + chiffrement). Cross-agent share semantics are wired in: pass share_with=[did1, did2, ...] and every saved memory is automatically shared.
from colber_langchain import ColberMemory
memory = ColberMemory(
agent_did="did:key:z6Mk...",
top_k=5,
share_with=["did:key:z6MkPeer1", "did:key:z6MkPeer2"],
)
A chat-history flavour (ColberChatMessageHistory) is also exported for use with RunnableWithMessageHistory.
ColberToolkit
Exposes the 6 Colber services as LangChain tools (one per operation, 14 in total).
from colber_langchain import ColberToolkit
toolkit = ColberToolkit()
tools = toolkit.get_tools() # list[BaseTool]
| Service | Tools |
|---|---|
identity |
colber_identity_register, colber_identity_resolve |
reputation |
colber_reputation_score, colber_reputation_feedback |
memory |
colber_memory_store, colber_memory_query, colber_memory_share |
negotiation |
colber_negotiation_start, colber_negotiation_propose, colber_negotiation_counter, colber_negotiation_settle |
insurance |
colber_insurance_quote, colber_insurance_subscribe, colber_insurance_claim |
Pass services=["negotiation", "insurance"] to scope down the surface for a deal-only agent.
The observability service is not exposed as a tool — ColberCallbackHandler already gives the agent first-class observability without LLM-driven calls.
Configuration
The plugin reads three environment variables when no explicit ColberClient is passed:
| Env var | Description |
|---|---|
COLBER_BASE_URLS |
JSON object mapping each of the 6 service names to its base URL. Wins if set. |
COLBER_BASE_URL |
Single ingress base URL (e.g. https://api.colber.dev); paths are appended internally per ColberClient.from_base_url. |
COLBER_AUTH_TOKEN |
Optional bearer token forwarded to every Colber service. |
If none are set, the plugin falls back to ColberClient.local() (β-VM ports on localhost).
You can always pass a pre-built client explicitly:
from colber_sdk import ColberClient
from colber_langchain import ColberToolkit
client = ColberClient.from_base_url("https://api.colber.dev", auth_token="...")
toolkit = ColberToolkit(client=client)
Out of scope (Wave 2.1+ follow-up)
- LangGraph integration (custom graph nodes wrapping Colber services).
- Custom prompt templates pre-baked with reputation/memory context.
- Attestation flow helpers (auto-sign + verify Colber payloads inside an agent loop).
These are noted as Wave 2.1+ follow-ups in the Colber ROADMAP.
License
Apache-2.0 — same license as colber-sdk and @colber/mcp.
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 colber_langchain-0.1.0.tar.gz.
File metadata
- Download URL: colber_langchain-0.1.0.tar.gz
- Upload date:
- Size: 23.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cb2d742abaa7a6be28c7d35ab2d861dd3d23b61fb91f0c872f702412e60f6031
|
|
| MD5 |
3df5fe1896361471f1c401f6bf0c6f83
|
|
| BLAKE2b-256 |
0c41d0fd0e514e6386b6b3cddad9cb5c149465ed7eaba91bdb9856800c487545
|
Provenance
The following attestation bundles were made for colber_langchain-0.1.0.tar.gz:
Publisher:
release-colber-langchain.yml on Obi49/Colber
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
colber_langchain-0.1.0.tar.gz -
Subject digest:
cb2d742abaa7a6be28c7d35ab2d861dd3d23b61fb91f0c872f702412e60f6031 - Sigstore transparency entry: 1477937293
- Sigstore integration time:
-
Permalink:
Obi49/Colber@e75f25c4b298280517376f6d2859cdd1b51afc1b -
Branch / Tag:
refs/tags/colber-langchain-v0.1.0 - Owner: https://github.com/Obi49
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-colber-langchain.yml@e75f25c4b298280517376f6d2859cdd1b51afc1b -
Trigger Event:
push
-
Statement type:
File details
Details for the file colber_langchain-0.1.0-py3-none-any.whl.
File metadata
- Download URL: colber_langchain-0.1.0-py3-none-any.whl
- Upload date:
- Size: 29.9 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 |
6faeaf2374ecac015b4498d0b4cbbfcbaafbd4a08c6fad63a70f6fc267e974bd
|
|
| MD5 |
47df33c379702f5b580972d3469f4366
|
|
| BLAKE2b-256 |
15b380e8461c6c5698a0bb0b20a03c6d99c8b75c39300885be5adfe925c5e6f7
|
Provenance
The following attestation bundles were made for colber_langchain-0.1.0-py3-none-any.whl:
Publisher:
release-colber-langchain.yml on Obi49/Colber
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
colber_langchain-0.1.0-py3-none-any.whl -
Subject digest:
6faeaf2374ecac015b4498d0b4cbbfcbaafbd4a08c6fad63a70f6fc267e974bd - Sigstore transparency entry: 1477937366
- Sigstore integration time:
-
Permalink:
Obi49/Colber@e75f25c4b298280517376f6d2859cdd1b51afc1b -
Branch / Tag:
refs/tags/colber-langchain-v0.1.0 - Owner: https://github.com/Obi49
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-colber-langchain.yml@e75f25c4b298280517376f6d2859cdd1b51afc1b -
Trigger Event:
push
-
Statement type: