Skip to main content

Context-M LangChain Adapter

Drop-in replacement for ConversationBufferMemory that routes through Context-M's REST API. Gives any LangChain agent access to Context-M's bi-temporal Trace, cryptographic provenance, Memory Git (branch/merge/diff/blame), ZK-lite proofs, federation-ready schema export, and the mu=0 ingest protocol (zero LLM calls during save).

Quickstart

from context_m_langchain import ContextMMemory
memory = ContextMMemory(user_id='alice')
memory.save_context(
    {'input': 'Hi I\'m Alice'},
    {'output': 'Nice to meet you, Alice!'})
memory.load_memory_variables(
    {'input': 'what\'s my name?'})

Configuration

Environment variables:

  • CONTEXT_M_REST_URL — default http://localhost:8900
  • CONTEXT_M_API_KEY — default empty (set if REST server requires RBAC)
  • CONTEXT_M_USER_ID — default "default"

What's new in v0.2.0 (2026-08-28)

  • Timeout raised to 10s default (was 5s) for large-context search.
  • intent field surfaced in load_memory_variables output.
  • save_context streams through the unmess pipeline by default.

Metadata

Release files for context-m-langchain 0.3.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 context-m-langchain 0.3.0
File Size Uploaded Provenance Actions
context_m_langchain-0.3.0.tar.gz 5.1 kB Without provenance Details for context_m_langchain-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for context-m-langchain 0.3.0
File Interpreter ABI Platform Actions
context_m_langchain-0.3.0-py3-none-any.whl Python 3 none any Details for context_m_langchain-0.3.0-py3-none-any.whl

Total release size: 10.1 kB

Release files / context_m_langchain-0.3.0.tar.gz

Download URL context_m_langchain-0.3.0.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a2d7ed9691bce9374a0a182183aab573de54992fb59c394e3fe37acf21d5fc93
BLAKE2b-256 checksum
How to use checksums
0f3aa0474d31fb13b2a0e576aca2c89665424de52d61627f9f5e20663c084c3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / context_m_langchain-0.3.0-py3-none-any.whl

Download URL context_m_langchain-0.3.0-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e5df86cbee24d4ac4b0e382c1c98c2fdc64593a7e26437d7751b007d5752d075
BLAKE2b-256 checksum
How to use checksums
eec319e3220ac7e52d059a67d4a9d7620a43c77e5f13e285a6e758fe933d8571
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Security for context-m-langchain 0.3.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.3.0 This release

2 release files No 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