Connect LangChain with explicit memory calls.

The langchain-memorae package provides a memory adapter and retriever for Python applications. Your code decides when to recall and save.

Minimal example

Use these values on a trusted local machine or server. Keep project credentials out of browser code.

python
import os
from langchain_memorae import MeMoraeMemory

# Backend environment: MEMORAE_API_KEY, MEMORAE_SUBJECT_ID,
# MEMORAE_BASE_URL=https://memora-singapore.onrender.com
memory = MeMoraeMemory(
    api_key=os.environ["MEMORAE_API_KEY"],
    base_url=os.environ["MEMORAE_BASE_URL"],
    subject_id=os.environ["MEMORAE_SUBJECT_ID"],
    namespace=os.getenv("MEMORAE_NAMESPACE", "default"),
)

# Submit a user fact. Processing and indexing happen asynchronously.
memory.save_context(
    {"input": "I like mangoes."},
    {"output": "Thanks for sharing."},
)
# Later, once the memory is active and indexed:
print(memory.load_memory_variables({"input": "What fruit do I like?"})["history"])

Check that it works

  1. Run a search for the subject and namespace you configured.
  2. Submit a source message with `save_context`; processing is asynchronous.
  3. After processing and indexing complete, search again for a directly supported detail.
  4. Use `MeMoraeRetriever.invoke(query)` when your chain expects LangChain Documents. A connected MCP server does not cause LangChain to save automatically; call save_context for each turn you choose to submit.

MAKE CONTEXT CARRY FORWARD

Continue with the product docs.

Learn the memory model, API configuration, lifecycle, and troubleshooting.

Get started