copass-langchain
LangChain tool adapters for Copass. Python mirror of @copass/langchain. Pulls discover / interpret / search into any LangChain agent, and (optionally) wires them into LangGraph's ReAct prebuilt.
Install
pip install copass-langchain
# or, with the create_copass_agent convenience wrapper:
pip install copass-langchain[agent]
Depends on copass-core + copass-config + langchain-core. langgraph is optional — only needed for create_copass_agent.
Drop-in tools
from copass_core import ApiKeyAuth, CopassClient
from copass_langchain import copass_tools
client = CopassClient(auth=ApiKeyAuth(key="olk_..."))
tools = copass_tools(client=client, sandbox_id="sb_...")
# Pass `tools.all()` (a list of three StructuredTool instances) to your
# agent framework, or pull them individually:
# tools.discover, tools.interpret, tools.search
Tool descriptions and parameter descriptions come from copass-config — identical to the strings used across every other Copass adapter.
Window-aware retrieval (when a Context Window exists)
copass-core v0.1 does not yet ship a ContextWindow class (deferred to v0.2). Until then, copass_tools and CopassWindowCallback accept any object satisfying ContextWindowLike:
class ContextWindowLike(Protocol):
def get_turns(self) -> list[ChatMessage]: ...
def add_turn(self, turn: ChatMessage) -> Awaitable[None]: ...
When copass-core ships ContextWindow, it will satisfy this protocol and window-aware retrieval will light up without any consumer changes.
Full agent in one call
from copass_langchain import create_copass_agent
from langchain_anthropic import ChatAnthropic
agent = create_copass_agent(
client=client,
sandbox_id="sb_...",
llm=ChatAnthropic(model="claude-opus-4-7"),
# window=my_window, # optional — enables window-aware retrieval + auto-mirroring
)
result = await agent.ainvoke({
"messages": [("user", "why is checkout flaky?")]
})
Status
copass_tools— shipped.CopassWindowCallback— shipped (generic onContextWindowLike).create_copass_agent— shipped (lazy-importslanggraph).- First-class
ContextWindowintegration — lands whencopass-corev0.2 ships the primitive.
Conversation metadata
CopassWindowCallback delegates to ContextWindow.add_turn, so any
speaker / participants configured on the underlying window flow
through automatically — no LangChain-specific wiring needed:
window = await client.context_window.create(
sandbox_id=sandbox_id,
participants=["User", "agent:support-bot"], # roster set once
)
callback = CopassWindowCallback(window=window)
When the LangChain callback emits a turn, the window's constructor-time
roster + role-derived speaker ride on the envelope. Set
ChatMessage.name on a turn for richer per-turn speaker provenance —
see copass-core for the full envelope surface.
License
MIT.
Release files for copass-langchain 1.4.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| copass_langchain-1.4.9.tar.gz | 10.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| copass_langchain-1.4.9-py3-none-any.whl | Python 3 | none | any | Details |
Total release size:20.3 kB
Release files / copass_langchain-1.4.9.tar.gz
| Download URL | copass_langchain-1.4.9.tar.gz |
|---|---|
| Size | 10.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
047679b35b817264f556b2b0d13f2c23ac3266588a8a437b3e629d17c74bf276
|
|
BLAKE2b-256 checksum How to use checksums |
9b2a28da65f458f4ef2d19410bade7162720911433fb43c439e0f3db02e92829
|
| 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 Jun 5, 2026.
Transparency logRelease files / copass_langchain-1.4.9-py3-none-any.whl
| Download URL | copass_langchain-1.4.9-py3-none-any.whl |
|---|---|
| Size | 10.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f76ecef732de2b4af3c436170f9bb962c74b8942eb239c6b277d61828b1ecd3a
|
|
BLAKE2b-256 checksum How to use checksums |
536b3e6aef3988c804d3acfbe11207bb398f0d5dff869f791319a1834064ae89
|
| 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 Jun 5, 2026.
Transparency log