Skip to main content

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.

Metadata

Release files for colber-langchain 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for colber-langchain 0.1.0
File Size Uploaded Provenance Actions
colber_langchain-0.1.0.tar.gz 23.2 kB With provenance Details for colber_langchain-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for colber-langchain 0.1.0
File Interpreter ABI Platform Actions
colber_langchain-0.1.0-py3-none-any.whl Python 3 none any Details for colber_langchain-0.1.0-py3-none-any.whl

Total release size: 53.1 kB

Release files / colber_langchain-0.1.0.tar.gz

Download URL colber_langchain-0.1.0.tar.gz
Size 23.2 kB
Tags Source
SHA-256 checksum
How to use checksums
cb2d742abaa7a6be28c7d35ab2d861dd3d23b61fb91f0c872f702412e60f6031
BLAKE2b-256 checksum
How to use checksums
0c41d0fd0e514e6386b6b3cddad9cb5c149465ed7eaba91bdb9856800c487545
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 8, 2026.

Transparency log

Release files / colber_langchain-0.1.0-py3-none-any.whl

Download URL colber_langchain-0.1.0-py3-none-any.whl
Size 29.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6faeaf2374ecac015b4498d0b4cbbfcbaafbd4a08c6fad63a70f6fc267e974bd
BLAKE2b-256 checksum
How to use checksums
15b380e8461c6c5698a0bb0b20a03c6d99c8b75c39300885be5adfe925c5e6f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 8, 2026.

Transparency log

Security for colber-langchain 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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for colber_langchain-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 8, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page