LangGraph
Expose GoodMem memory operations as LangGraph tools to give graphs and agents long-term semantic memory.
Overview
GoodMem is a memory layer for AI agents that handles embedding, vector search, reranking, and
LLM-powered answering server-side. The LangGraph integration exposes those operations —
creating spaces, storing memories, and semantic retrieval — as LangGraph tools you can bind to
any prebuilt agent, ToolNode, or custom graph to give it long-term semantic memory.
Installation
pip install langgraph-goodmemThe pip package is langgraph-goodmem; the import name is langgraph_goodmem. Requires Python 3.10+.
Configuration
| Variable | Description |
|---|---|
GOODMEM_BASE_URL | Base URL of your GoodMem server (no /v1 suffix), e.g. https://your-goodmem-server.example.com. |
GOODMEM_API_KEY | API key used to authenticate requests. |
GOODMEM_VERIFY_SSL | Set to false to skip TLS verification for self-signed dev certs (default: true). |
Each tool also accepts goodmem_base_url and goodmem_api_key constructor arguments if you
prefer to configure them in code instead of the environment.
Quick start
from langgraph_goodmem import (
GoodMemCreateSpace,
GoodMemCreateMemory,
GoodMemRetrieveMemories,
)
from langgraph.prebuilt import create_react_agent
goodmem_kwargs = {
"goodmem_base_url": "https://your-goodmem-server.example.com",
"goodmem_api_key": "your-api-key",
}
tools = [
GoodMemCreateSpace(**goodmem_kwargs),
GoodMemCreateMemory(**goodmem_kwargs),
GoodMemRetrieveMemories(**goodmem_kwargs),
]
agent = create_react_agent(model="gpt-4o", tools=tools)Local development. The example above uses a TLS-verified production URL. If you are running
GoodMem locally with a self-signed certificate, use https://localhost:8080 and disable TLS
verification with the client's verify-SSL option (see the Configuration table above). Keep TLS
verification enabled for any deployed server.
Retrieval post-processing
GoodMem's retrieval call accepts these optional post-processing parameters (each framework exposes them under its own naming convention):
| Parameter | Range | Description |
|---|---|---|
reranker_id | UUID | Reranker model that reorders matched chunks by relevance. |
llm_id | UUID | LLM that generates a contextual answer (abstractReply) alongside the chunks. |
relevance_threshold | 0–1 | Minimum relevance score for a result to be included. |
llm_temperature | 0–2 | Sampling temperature for the LLM post-processor. |
max_results | integer | Maximum number of results to return. |
chronological_resort | boolean | Re-sort the final results by creation time instead of relevance. |
Learn more
The full README, examples, and API reference are available on the PyPI package page.