anlyon-langchain
LangChain integration for Anlyon: AnlyonVectorStore and AnlyonRetriever over Anlyon Memory, AnlyonChatMessageHistory over Anlyon Sessions, and AnlyonTracer for nested run/span tracing.
Trace a LangChain invocation
from anlyon import Client
from anlyon_langchain import AnlyonTracer
client = Client(api_key="anlyon_live_...")
tracer = AnlyonTracer(client, application="support-agent")
# Pass the callback to any LangChain runnable/agent invocation.
result = chain.invoke({"question": "Where is my order?"}, config={"callbacks": [tracer]})
The handler creates one Anlyon run for the root callback and parent-linked
workflow_step, model_call, and tool_call spans for nested callbacks. It is
best-effort: Anlyon transport failures never change the application result.
Installation
pip install anlyon-langchain
Retrieval
from anlyon import Client
from anlyon_langchain import AnlyonVectorStore
client = Client() # uses ANLYON_API_KEY
store = AnlyonVectorStore(client, collection="docs")
retriever = store.as_retriever()
Chat history
AnlyonChatMessageHistory puts a chain's conversation in an Anlyon Session durable across processes, and summarized automatically once the thread gets long.
from anlyon import Client
from anlyon_langchain import AnlyonChatMessageHistory
from langchain_core.runnables.history import RunnableWithMessageHistory
client = Client()
chain_with_history = RunnableWithMessageHistory(
chain,
lambda session_id: AnlyonChatMessageHistory(client, session_id),
input_messages_key="input",
history_messages_key="history",
)
# `session_id` is an Anlyon session id create one with client.sessions.create()
chain_with_history.invoke(
{"input": "Where is my order?"},
config={"configurable": {"session_id": "ses_abc123"}},
)
.messages reads the thread back as LangChain messages, .add_messages() appends a turn in one round-trip, and .clear() truncates the thread while keeping the session id usable.
See the Anlyon docs for the full guide.
License
MIT
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 anlyon_langchain-0.1.0.tar.gz.
File metadata
- Download URL: anlyon_langchain-0.1.0.tar.gz
- Upload date:
- Size: 10.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb91f1b4106cfad14bf9a936b1a192012080ee790a316a97986316178485846e
|
|
| MD5 |
18f8f4a2f6d5a49d1b18f524b5fe7509
|
|
| BLAKE2b-256 |
45add4886d25a5db47562aacac63d16a4e73d7a8255657ee42167f3cf1eeaf08
|
Provenance
The following attestation bundles were made for anlyon_langchain-0.1.0.tar.gz:
Publisher:
publish-python.yml on AnlyonHQ/anlyon-platform
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
anlyon_langchain-0.1.0.tar.gz -
Subject digest:
bb91f1b4106cfad14bf9a936b1a192012080ee790a316a97986316178485846e - Sigstore transparency entry: 2753122434
- Sigstore integration time:
-
Permalink:
AnlyonHQ/anlyon-platform@53458316393b482808797ab96437331b628adf80 -
Branch / Tag:
refs/tags/python-v0.1.0 - Owner: https://github.com/AnlyonHQ
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@53458316393b482808797ab96437331b628adf80 -
Trigger Event:
release
-
Statement type:
File details
Details for the file anlyon_langchain-0.1.0-py3-none-any.whl.
File metadata
- Download URL: anlyon_langchain-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3400f8d8b1191085ef733463ffd2ce67045e98471d283552d3477c04879e3adf
|
|
| MD5 |
48b876bfa9895250cf0f164cabb8d521
|
|
| BLAKE2b-256 |
dc66dc06a9b37d6df7b8e06dde273a2626e0417c2e1b939d7a2ee168c6f0f709
|
Provenance
The following attestation bundles were made for anlyon_langchain-0.1.0-py3-none-any.whl:
Publisher:
publish-python.yml on AnlyonHQ/anlyon-platform
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
anlyon_langchain-0.1.0-py3-none-any.whl -
Subject digest:
3400f8d8b1191085ef733463ffd2ce67045e98471d283552d3477c04879e3adf - Sigstore transparency entry: 2753122447
- Sigstore integration time:
-
Permalink:
AnlyonHQ/anlyon-platform@53458316393b482808797ab96437331b628adf80 -
Branch / Tag:
refs/tags/python-v0.1.0 - Owner: https://github.com/AnlyonHQ
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@53458316393b482808797ab96437331b628adf80 -
Trigger Event:
release
-
Statement type: