Carry an AlgoVoi keystone decision into a LangChain run trace: a recomputable execution_ref under algovoi.keystone.*, verifiable offline
Project description
algovoi-keystone-langchain
Carry an AlgoVoi keystone decision into a LangChain run trace. The decision's content-addressed
execution_ref rides along as run metadata and a tag, under the vendor namespace
algovoi.keystone.* (never inside a LangChain reserved field). Anyone reading the trace recomputes
execution_ref from the run metadata alone with only JCS (RFC 8785) and SHA-256, and confirms the
agent's recorded action is consistent with the decision that authorized it. The reference is bound
to the decision, not merely correlated with a run.
from algovoi_keystone_langchain import keystone_config, verify_trace_execution_ref
# attach the keystone reference to a LangChain run
result = chain.invoke(
user_input,
config=keystone_config(
decision_ref="sha256:2a444c62...", # the pre-payment decision (from the keystone)
action_type="payment", scope="bilateral",
outcome="COMMITTED", executed_at_ms=1716460800000,
),
)
The run's metadata now carries algovoi.keystone.execution_ref and the keystone preimage fields, so
LangSmith (or any tracer) shows a recomputable reference. Verify it offline from the metadata:
verify_trace_execution_ref(run.metadata) # True iff execution_ref recomputes
keystone_trace_metadata(...) returns the framework-neutral attribute dict if you want to attach it
yourself; make_callback_handler(...) builds a LangChain callback handler (needs the langchain
extra) carrying the same metadata. Python and TypeScript (@algovoi/keystone-langchain) produce the
same execution_ref byte for byte. Apache-2.0.
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 algovoi_keystone_langchain-0.1.0.tar.gz.
File metadata
- Download URL: algovoi_keystone_langchain-0.1.0.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
653ded7481018ad1772f7c09d19029c9b7e3699e0c7a842864b613fcb0f7104a
|
|
| MD5 |
69644358f1c2ace6e50e0bc5487578c5
|
|
| BLAKE2b-256 |
94b7ffb7be4c54e63a71ea10f57eec45cc723ebbcf9300dbca3612b5172d1303
|
File details
Details for the file algovoi_keystone_langchain-0.1.0-py3-none-any.whl.
File metadata
- Download URL: algovoi_keystone_langchain-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
01e10e2851349528c79e2335bd4ee09d6e34b54c8c48d5f61b214919fe782dff
|
|
| MD5 |
e3a5fd91e292e8a0066a41b3ed70ee69
|
|
| BLAKE2b-256 |
66381f2736ae9ac5a777d9c4610843498418b9571d1f542f1aaee63c32c8c9d1
|