LangChain integration for GoodMem: long-term agent memory with semantic storage and retrieval.
Project description
langchain-goodmem
LangChain integration for GoodMem — long-term agent memory with semantic storage and retrieval.
GoodMem is a memory layer for AI agents that handles embedding, vector search, reranking, and LLM-powered answering server-side. This package exposes GoodMem operations as LangChain BaseTools that can be wired into any LangChain agent or chain.
Installation
pip install langchain-goodmem
Requires Python 3.10+.
Tools
| Tool | Description |
|---|---|
GoodMemListEmbedders |
List available embedder models |
GoodMemListSpaces |
List all spaces in your account |
GoodMemGetSpace |
Fetch a single space by ID |
GoodMemCreateSpace |
Create a new space or reuse an existing one |
GoodMemUpdateSpace |
Update name / public-read / labels on a space |
GoodMemDeleteSpace |
Delete a space (cascades to its memories) |
GoodMemCreateMemory |
Store text or files as memories |
GoodMemListMemories |
Paginate memories within a space |
GoodMemRetrieveMemories |
Semantic search with optional reranker / LLM summary |
GoodMemGetMemory |
Fetch a specific memory by ID |
GoodMemDeleteMemory |
Permanently delete a memory |
Quick start
from langchain_goodmem import (
GoodMemCreateSpace,
GoodMemCreateMemory,
GoodMemRetrieveMemories,
)
goodmem_kwargs = {
"goodmem_base_url": "http://localhost:8080",
"goodmem_api_key": "your-api-key",
}
tools = [
GoodMemCreateSpace(**goodmem_kwargs),
GoodMemCreateMemory(**goodmem_kwargs),
GoodMemRetrieveMemories(**goodmem_kwargs),
]
Use with a LangChain agent
from langchain.chat_models import init_chat_model
from langchain.agents import create_agent
llm = init_chat_model("openai:gpt-4o")
agent = create_agent(llm, tools)
response = agent.invoke({"messages": [{"role": "user", "content": "Save this fact and recall it later."}]})
Retrieve with reranking and LLM summary
GoodMemRetrieveMemories exposes the full server-side post-processor. Set any of these fields to enable reranking, threshold filtering, chronological re-sort, or an LLM-generated abstractReply summary:
result = retrieve.invoke({
"query": "Which framework develops applications with language models?",
"space_ids": "space-uuid-1,space-uuid-2",
"max_results": 5,
"reranker_id": "reranker-uuid",
"llm_id": "llm-uuid",
"llm_temperature": 0.2,
"relevance_threshold": 0.1,
"chronological_resort": False,
})
Leave them all unset for plain semantic search.
Environment variables
| Variable | Description |
|---|---|
GOODMEM_BASE_URL |
Base URL of the GoodMem API server |
GOODMEM_API_KEY |
API key for authentication |
GOODMEM_VERIFY_SSL |
Set to false to skip TLS verification for self-signed dev certs (default: true) |
Examples
A live end-to-end smoke test exercising every tool and every post-processor knob is in examples/live_smoke_test.py.
export GOODMEM_BASE_URL=https://localhost:8080
export GOODMEM_API_KEY=...
export GOODMEM_VERIFY_SSL=false
python examples/live_smoke_test.py
License
MIT — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file langchain_goodmem-0.1.0.tar.gz.
File metadata
- Download URL: langchain_goodmem-0.1.0.tar.gz
- Upload date:
- Size: 106.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f5731322cf31ea7cbf6b7fa7bbcecc5a5d3517eb0f0d1e4ecf0d28ee3d1b672
|
|
| MD5 |
941119f47bb8e5a5e103e76e255bc04b
|
|
| BLAKE2b-256 |
aeee52eb3060d6a97763ffb4070fa6be863ab9b9456ed3ccd66d8cc7e79518dc
|
Provenance
The following attestation bundles were made for langchain_goodmem-0.1.0.tar.gz:
Publisher:
release.yml on PAIR-Systems-Inc/goodmem-langchain
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
langchain_goodmem-0.1.0.tar.gz -
Subject digest:
5f5731322cf31ea7cbf6b7fa7bbcecc5a5d3517eb0f0d1e4ecf0d28ee3d1b672 - Sigstore transparency entry: 1463122399
- Sigstore integration time:
-
Permalink:
PAIR-Systems-Inc/goodmem-langchain@07f087e9570f2a6cf52205b3d01cae0382d17a35 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/PAIR-Systems-Inc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@07f087e9570f2a6cf52205b3d01cae0382d17a35 -
Trigger Event:
push
-
Statement type:
File details
Details for the file langchain_goodmem-0.1.0-py3-none-any.whl.
File metadata
- Download URL: langchain_goodmem-0.1.0-py3-none-any.whl
- Upload date:
- Size: 25.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
214492a4702e126f7814284a6b5aec4e35ef8dbbc3be4323d14f879ddabb5d8b
|
|
| MD5 |
f84a2846fe77e1aa9a9d849891a04dd6
|
|
| BLAKE2b-256 |
bfa494236d2f38a4db4320de50adb8c45751c04ea85f867c6a408177f6d171d4
|
Provenance
The following attestation bundles were made for langchain_goodmem-0.1.0-py3-none-any.whl:
Publisher:
release.yml on PAIR-Systems-Inc/goodmem-langchain
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
langchain_goodmem-0.1.0-py3-none-any.whl -
Subject digest:
214492a4702e126f7814284a6b5aec4e35ef8dbbc3be4323d14f879ddabb5d8b - Sigstore transparency entry: 1463122432
- Sigstore integration time:
-
Permalink:
PAIR-Systems-Inc/goodmem-langchain@07f087e9570f2a6cf52205b3d01cae0382d17a35 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/PAIR-Systems-Inc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@07f087e9570f2a6cf52205b3d01cae0382d17a35 -
Trigger Event:
push
-
Statement type: