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.1.0.tar.gz (10.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.1.0-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: maximem_synap_langchain-0.1.0.tar.gz
  • Upload date:
  • Size: 10.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.1.0.tar.gz
Algorithm Hash digest
SHA256 c559675dbea63925cdc28e4e30b4e0be8bbb7bd3eb6a7ab8a8984be2c53d5f7e
MD5 a0a95fc037a4515057ca7cbd1c53670b
BLAKE2b-256 5656b109f0b3157ac106f248cf7cc4fb1c741d8dab2ff3276486227f6cb7b2ef

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for maximem_synap_langchain-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 615850e263f9d2e23486a78f71db442659181b34825192ab8c71b5cbca7b8128
MD5 35a0abd12e7c2b9ab9cf451e9ec97ee9
BLAKE2b-256 cec68c46abae67fd6faecaa787b3cc3ea81b17269d83876f9c2a553d93f05985

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