Skip to main content

LangGraph tools and integration for Memanto's persistent memory

Project description

LangGraph + Memanto Integration

This package provides native LangGraph tools and a standalone memory layer for integrating Memanto's persistent, cross-session memory capabilities into LangGraph agents.

Installation

pip install langgraph-memanto

Features

  • Native LangChain Tools: Easy-to-use @tool wrappers that LangGraph agents can autonomously call (memanto_remember, memanto_recall, memanto_answer).
  • Graph Nodes: Pre-built nodes (create_recall_node, create_remember_node) for automatic memory injection and storage within your graph.
  • Cross-Session Persistence: Memories stored by your agents survive across threads, sessions, and even different agents within the same namespace.
  • BaseStore Implementation: Use MemantoStore as a drop-in replacement for LangGraph's BaseStore to persist memories using Memanto through the official LangGraph store API.

Usage

Using MemantoStore

You can use MemantoStore as the backend for the official LangGraph Store abstraction. This gives your graph persistent, cross-thread, and cross-session memory automatically.

from langgraph_memanto import MemantoStore
from langgraph.graph import StateGraph, MessagesState
from langgraph.checkpoint.memory import MemorySaver

# Initialize the MemantoStore (uses api_key instead of client object directly)
store = MemantoStore(api_key="your_moorcheh_api_key")

# Build your graph as normal
builder = StateGraph(MessagesState)
builder.add_node("agent", agent_node)
# ... add edges ...

# Compile with the store
graph = builder.compile(
    store=store,
    checkpointer=MemorySaver()
)

# Nodes can now access the store via langgraph.store.base.BaseStore API
# e.g., store.put(namespace, key, {"content": "...", "type": "fact"})

Using Tools

from langgraph_memanto import create_memanto_tools
from memanto.cli.client.sdk_client import SdkClient

# Initialize the Memanto SDK Client
client = SdkClient(api_key="your_moorcheh_api_key")

# Get native LangChain tools
# The tools will automatically ensure the agent is created and activated 
# the first time the LLM tries to call them!
tools = create_memanto_tools(client, "my-langgraph-agent")

# Bind them to your LLM
llm_with_tools = llm.bind_tools(tools)

Using Nodes

Add recall and remember nodes to your graph for automatic memory retrieval before LLM calls and storage after responses.

from langgraph_memanto import create_recall_node, create_remember_node
from memanto.cli.client.sdk_client import SdkClient
from langgraph.graph import StateGraph, MessagesState, START, END

client = SdkClient(api_key="your_moorcheh_api_key")

# Nodes can dynamically use an agent_id from the graph's config
recall = create_recall_node(client=client, agent_id_from_config="agent_id")
remember = create_remember_node(
    client=client,
    agent_id_from_config="agent_id"
)

builder = StateGraph(MessagesState)
builder.add_node("recall", recall)
builder.add_node("agent", agent_node)  # your LLM node
builder.add_node("remember", remember)

builder.add_edge(START, "recall")
builder.add_edge("recall", "agent")
builder.add_edge("agent", "remember")
builder.add_edge("remember", END)

graph = builder.compile()

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

langgraph_memanto-0.1.1.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

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

langgraph_memanto-0.1.1-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file langgraph_memanto-0.1.1.tar.gz.

File metadata

  • Download URL: langgraph_memanto-0.1.1.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for langgraph_memanto-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6b446ed6afde21eddc01bef0e2e36c44553753055e57a842075c8e2395821fbf
MD5 fe8e237d1d30d12975dfc8eaeab3b844
BLAKE2b-256 598850fdb6c7090fd879b32c6a78b48e59253b58a4ceb4e467f4b299ae7809a9

See more details on using hashes here.

File details

Details for the file langgraph_memanto-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for langgraph_memanto-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8286d8fc3dabe059b7a0e7a35d72833aab2e6e1b1489f712349167401a197563
MD5 c09f6cd283ad68fe34ab24de409745df
BLAKE2b-256 3b45f028c24d8f9c3353926e40df2a2642407e9ea39f49adf70b17b040467bcc

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