AutoGen 0.4+ integration for the Colber platform — per-tool observability, AutoGen Memory adapter, and a 5-service toolkit of typed BaseTool[Args, Result] subclasses.
Project description
colber-autogen
AutoGen 0.4+ integration for the Colber platform — per-tool observability instrumentation, an autogen_core.memory.Memory adapter backed by colber-memory, and a 5-service toolkit of typed BaseTool[Args, Result] subclasses. Apache-2.0.
This is the third framework plugin in the "Lego" GTM lever (after colber-langchain and colber-crewai). It depends only on autogen-agentchat>=0.4 + autogen-core>=0.4 and the published colber-sdk PyPI release, so it stays lightweight and is independently versionable.
AutoGen 0.4 only. This plugin targets the Microsoft 2024-2025 redesign (
autogen-agentchat+autogen-core). It does not depend on the legacypyautogen0.2 line.
Install
pip install colber-autogen
For local development inside the Colber monorepo:
pip install -e apps/colber-autogen
Components
ColberToolInstrumentation
Wraps any AutoGen BaseTool (Colber-backed or not) so each call emits one Colber observability span (and one error log on failure). AutoGen 0.4 has no native step_callback equivalent to CrewAI, so we instrument at the tool boundary — that's the cleanest seam in AutoGen's "tools are first-class" architecture.
from autogen_agentchat.agents import AssistantAgent
from autogen_ext.models.openai import OpenAIChatCompletionClient
from colber_autogen import ColberToolInstrumentation, ColberToolkit
instr = ColberToolInstrumentation(
agent_did="did:key:z6Mk...",
operator_id="op-demo",
service_name="my-autogen-agent",
)
toolkit = ColberToolkit(agent_did="did:key:z6Mk...")
tools = instr.wrap_all(toolkit.get_tools())
agent = AssistantAgent(
name="trader",
model_client=OpenAIChatCompletionClient(model="gpt-4o-mini"),
tools=tools,
)
Each tool call emits one span (/v1/observability/traces) with traceId, spanId, name=tool.<tool_name>, durationMs, status, and a small attributes dict. Errors additionally emit a structured log event (/v1/observability/logs) at level=error, then propagate.
The wrapper preserves the underlying tool's name, description, args_type, return_type, and schema — the LLM sees the exact same tool definition.
Network failures to the observability backend are caught, logged at WARNING, and swallowed — the agent run is never aborted because telemetry is sick.
ColberAgentMessageHook (optional)
For operators who want turn-level spans (one per agent message), call ColberAgentMessageHook from the operator-side iteration over agent.on_messages_stream:
from colber_autogen import ColberAgentMessageHook
hook = ColberAgentMessageHook(
agent_did="did:key:z6Mk...",
operator_id="op-demo",
)
async for message in agent.on_messages_stream(messages, cancellation_token):
hook(message)
This is supplementary to ColberToolInstrumentation. Most users only need the tool-level instrumentation.
ColberMemory
Implements AutoGen 0.4's autogen_core.memory.Memory protocol against the colber-memory service (Qdrant + ACL + chiffrement, with cross-agent share semantics).
from autogen_agentchat.agents import AssistantAgent
from colber_autogen import ColberMemory
memory = ColberMemory(
agent_did="did:key:z6Mk...",
top_k=5,
share_with=["did:key:z6MkPeer1"],
)
agent = AssistantAgent(
name="trader",
model_client=...,
memory=[memory],
)
Five protocol methods are implemented:
| Method | Behaviour |
|---|---|
add(content) |
Calls colber-memory.store (and share when share_with is configured). Tolerant — transport errors are logged and swallowed. |
query(query, top_k=, score_threshold=) |
Calls colber-memory.search scoped to agent_did. Returns MemoryQueryResult of MemoryContent hits. |
update_context(model_context) |
Reads the last user/system message, runs query, appends a SystemMessage summarising the hits (mirrors the ListMemory reference shape). |
clear() |
Logged no-op until colber-memory ships a bulk-delete-by-owner endpoint (Wave 2.4 follow-up). |
close() |
No-op — the SDK client's lifecycle is owned by the caller. |
ColberToolkit
Exposes 5 Colber services as AutoGen BaseTool[Args, str] subclasses (one per operation, 14 in total).
from colber_autogen import ColberToolkit
toolkit = ColberToolkit(agent_did="did:key:z6Mk...")
tools = toolkit.get_tools() # list[autogen_core.tools.BaseTool]
# Plug into any AssistantAgent.
agent = AssistantAgent(name="negotiator", tools=tools, ...)
| 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. Letting an LLM call log_ingest is a footgun (the agent could DoS its own log pipeline). Use ColberToolInstrumentation for telemetry — it gives the agent first-class observability without LLM-driven calls. Passing services=["observability"] raises ValueError with the explicit reason.
Each tool subclasses autogen_core.tools.BaseTool[ArgsT, str] with a per-tool Pydantic v2 args model, so AutoGen's strict tool runner gets full schema validation up-front (and mypy --strict passes on the whole surface).
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_autogen import ColberToolkit
client = ColberClient.from_base_url("https://api.colber.dev", auth_token="...")
toolkit = ColberToolkit(client=client, agent_did="did:key:z6Mk...")
AutoGen version requirement
autogen-agentchat>=0.4,<1 and autogen-core>=0.4,<1. The 0.4 line stabilised the public extension points this plugin depends on (autogen_core.tools.BaseTool[ArgsT, ReturnT], autogen_core.memory.Memory protocol, AssistantAgent.tools= + memory= kwargs). The legacy pyautogen 0.2 line uses a different programming model and is not supported.
Concurrency notes
The colber-sdk client is synchronous (httpx.Client). Every plugin component lifts blocking SDK calls into asyncio.to_thread so AutoGen's event loop is never stalled. The SDK client is thread-safe, so concurrent tool calls + memory operations are safe under asyncio concurrency.
Out of scope (Wave 2.4+ follow-up)
- Native agent-level callback hook once AutoGen 0.4 lands a stable equivalent of CrewAI's
step_callback(cf. microsoft/autogen#5891 — currently the wrapper-per-tool path is the cleanest framework-aligned answer). colber-memorybulk-delete-by-owner endpoint forMemory.clear()to do real work.- Custom
ChatCompletionContextsubclass that auto-injects Colber memories without an explicitupdate_contextcall.
These are noted as Wave 2.4+ follow-ups in the Colber ROADMAP.
License
Apache-2.0 — same license as colber-sdk, colber-langchain, colber-crewai, 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_autogen-0.1.0.tar.gz.
File metadata
- Download URL: colber_autogen-0.1.0.tar.gz
- Upload date:
- Size: 28.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b3a34296d7687d13fe0319aa71aaba0e7453be4593a4881fdac21309de818fbb
|
|
| MD5 |
2eb8ad8ed3f27d3c97ef9d2b68088a06
|
|
| BLAKE2b-256 |
a79aa299011e820ecd7315e8525eed9bfb01d90e32c2652f31292906796a7b09
|
Provenance
The following attestation bundles were made for colber_autogen-0.1.0.tar.gz:
Publisher:
release-colber-autogen.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_autogen-0.1.0.tar.gz -
Subject digest:
b3a34296d7687d13fe0319aa71aaba0e7453be4593a4881fdac21309de818fbb - Sigstore transparency entry: 1477930611
- Sigstore integration time:
-
Permalink:
Obi49/Colber@e75f25c4b298280517376f6d2859cdd1b51afc1b -
Branch / Tag:
refs/tags/colber-autogen-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-autogen.yml@e75f25c4b298280517376f6d2859cdd1b51afc1b -
Trigger Event:
push
-
Statement type:
File details
Details for the file colber_autogen-0.1.0-py3-none-any.whl.
File metadata
- Download URL: colber_autogen-0.1.0-py3-none-any.whl
- Upload date:
- Size: 36.1 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 |
1d267798f2f422902e232772bcd74f5a04eb7c38a7044792982d21f26fecdabb
|
|
| MD5 |
ac092600863277ef749f2e25abbf42d2
|
|
| BLAKE2b-256 |
ec943db66b374dce6f52174e975da30f47d21cd0ad1a0cef37785353adc4ff18
|
Provenance
The following attestation bundles were made for colber_autogen-0.1.0-py3-none-any.whl:
Publisher:
release-colber-autogen.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_autogen-0.1.0-py3-none-any.whl -
Subject digest:
1d267798f2f422902e232772bcd74f5a04eb7c38a7044792982d21f26fecdabb - Sigstore transparency entry: 1477930891
- Sigstore integration time:
-
Permalink:
Obi49/Colber@e75f25c4b298280517376f6d2859cdd1b51afc1b -
Branch / Tag:
refs/tags/colber-autogen-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-autogen.yml@e75f25c4b298280517376f6d2859cdd1b51afc1b -
Trigger Event:
push
-
Statement type: