Metadata-Version: 2.4
Name: context-m-langchain
Version: 0.3.0
Summary: LangChain BaseMemory adapter for Context-M — the Universal Neuro-Symbolic Memory Fabric.
Home-page: https://github.com/ssmurfgg04-gif/context-m
Author: Context-M maintainers
Author-email: maintainers@context-m.dev
License: Apache-2.0
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Provides-Extra: langchain
Requires-Dist: langchain>=0.1.0; extra == "langchain"
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: langchain>=0.1.0; extra == "dev"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license
Dynamic: provides-extra
Dynamic: requires-python
Dynamic: summary

# 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

```python
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.
