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.3.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.3.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for context_m_langchain-0.3.0.tar.gz
Algorithm Hash digest
SHA256 a2d7ed9691bce9374a0a182183aab573de54992fb59c394e3fe37acf21d5fc93
MD5 e19a172a0253f7df3a8128802a21cec5
BLAKE2b-256 0f3aa0474d31fb13b2a0e576aca2c89665424de52d61627f9f5e20663c084c3f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for context_m_langchain-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e5df86cbee24d4ac4b0e382c1c98c2fdc64593a7e26437d7751b007d5752d075
MD5 69893a4dd3814abf071f369bd52965af
BLAKE2b-256 eec319e3220ac7e52d059a67d4a9d7620a43c77e5f13e285a6e758fe933d8571

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 files

0.2.0

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