Skip to main content

Synap memory integration for LangChain

Project description

maximem-synap-langchain

Synap memory integration for LangChain.

Install

pip install maximem-synap-langchain

Requires langchain-core>=0.3, maximem-synap>=0.2.0.

What's in the box

  • SynapChatMessageHistoryBaseChatMessageHistory for use with RunnableWithMessageHistory. Persists conversation turns to Synap's short-term + long-term memory.
  • SynapRetrieverBaseRetriever for RAG pipelines. Returns typed memory items (memories, entities, triples, chunks) via sdk.fetch.
  • SynapSearchTool / SynapStoreTool — Agent tools for explicit memory read/write inside a tool-using LangChain agent.
  • SynapCallbackHandler — Zero-config callback that auto-records LLM input/output as conversation turns.
  • create_synap_node — Helper that builds a LangGraph-compatible node which injects retrieved Synap context into graph state.

Quickstart

from langchain_core.runnables.history import RunnableWithMessageHistory
from maximem_synap import MaximemSynapSDK
from synap_langchain import SynapChatMessageHistory

sdk = MaximemSynapSDK(api_key="sk-...")

def get_history(session_id: str) -> SynapChatMessageHistory:
    return SynapChatMessageHistory(sdk, user_id=session_id, customer_id="acme")

chain_with_memory = RunnableWithMessageHistory(
    chain,
    get_history,
    input_messages_key="input",
    history_messages_key="history",
)

License

Apache-2.0

Project details


Download files

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

Source Distribution

maximem_synap_langchain-0.2.0.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

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

maximem_synap_langchain-0.2.0-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: maximem_synap_langchain-0.2.0.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for maximem_synap_langchain-0.2.0.tar.gz
Algorithm Hash digest
SHA256 34b5d949927c5ce87863420d2e2e545b0c56c7014bbcec7571b5360f9ed40fe8
MD5 e995458f32e41f42b1e9bb33fb4819a3
BLAKE2b-256 cc2c8055f35176d987e65525121da4be0fc5e711c78f08aa4dce3bc1f7b71acb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for maximem_synap_langchain-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9c9c957ddf4d90a2a1c378f3d2dbb0a0c49334dba53d5ea323b1c8022a02b06e
MD5 95ee44013009d6befc886f6980f93b6a
BLAKE2b-256 75746102f494f206c59ede5129f95db9842aaffd2320129d0630fc83d2679e84

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page