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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

context_m_langchain-0.2.0.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

context_m_langchain-0.2.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file context_m_langchain-0.2.0.tar.gz.

File metadata

  • Download URL: context_m_langchain-0.2.0.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.5

File hashes

Hashes for context_m_langchain-0.2.0.tar.gz
Algorithm Hash digest
SHA256 631f95fe641ef665393a53a0ab223e93852006170ca1ff7666b3f98035beda7b
MD5 c6c45c30787908fe72c4cc7ad11946a3
BLAKE2b-256 217855dc4b7a4d6ebdcd5c2d44493bdf835a29db0dc77bb049416213e39492f2

See more details on using hashes here.

File details

Details for the file context_m_langchain-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for context_m_langchain-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aab51e7d729cb00039c54f69676ecc6c9ec7ff7040a59e9e426bfaace0e562e7
MD5 f47f5dfb0f37fb997b9fb28f90413a27
BLAKE2b-256 758f454772175769eedcaa41c8b1a7586cee5863ca04055fe237e34816ab433c

See more details on using hashes here.

Release history Release notifications | RSS feed

0.3.0

2 files

This release

0.2.0 This release

2 files

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