Metadata-Version: 2.4
Name: langgraph-goodmem
Version: 0.1.0
Summary: LangGraph integration for GoodMem: long-term agent memory with semantic storage and retrieval.
Project-URL: Homepage, https://github.com/PAIR-Systems-Inc/goodmem-langgraph
Project-URL: Repository, https://github.com/PAIR-Systems-Inc/goodmem-langgraph
Project-URL: Documentation, https://goodmem.ai/docs
Project-URL: Issues, https://github.com/PAIR-Systems-Inc/goodmem-langgraph/issues
License-Expression: MIT
License-File: LICENSE
Keywords: agents,goodmem,langgraph,llm,memory,semantic-search,vector-search
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Typing :: Typed
Requires-Python: <4.0.0,>=3.10.0
Requires-Dist: httpx<1.0.0,>=0.27.0
Requires-Dist: langchain-core<2.0.0,>=1.0.0
Requires-Dist: pydantic<3.0.0,>=2.7.4
Description-Content-Type: text/markdown

# langgraph-goodmem

[![PyPI](https://img.shields.io/pypi/v/langgraph-goodmem.svg)](https://pypi.org/project/langgraph-goodmem/)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)

LangGraph integration for [GoodMem](https://goodmem.ai) — 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 LangGraph tools that can be used with any LangGraph agent or graph.

## Installation

```bash
pip install langgraph-goodmem
```

Requires Python 3.10+.

## Tools

| Tool | Description |
|---|---|
| `GoodMemListEmbedders` | List available embedder models |
| `GoodMemListSpaces` | List all spaces in your account |
| `GoodMemGetSpace` | Fetch a specific space by ID |
| `GoodMemCreateSpace` | Create a new space or reuse an existing one |
| `GoodMemUpdateSpace` | Update a space's name or metadata |
| `GoodMemDeleteSpace` | Delete a space and all of its memories |
| `GoodMemCreateMemory` | Store text or files as memories |
| `GoodMemListMemories` | List memories in a space |
| `GoodMemGetMemory` | Fetch a specific memory by ID |
| `GoodMemRetrieveMemories` | Semantic similarity search across spaces |
| `GoodMemDeleteMemory` | Permanently delete a memory |

## Quick start

```python
from langgraph_goodmem import (
    GoodMemCreateSpace,
    GoodMemCreateMemory,
    GoodMemRetrieveMemories,
)
from langgraph.prebuilt import create_react_agent

goodmem_kwargs = {
    "goodmem_base_url": "http://localhost:8080",
    "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)
```

## Usage in a custom LangGraph graph

```python
from langgraph.graph import StateGraph, START, END
from langgraph.prebuilt import ToolNode
from langgraph_goodmem import (
    GoodMemCreateSpace,
    GoodMemCreateMemory,
    GoodMemRetrieveMemories,
)

tools = [
    GoodMemCreateSpace(**goodmem_kwargs),
    GoodMemCreateMemory(**goodmem_kwargs),
    GoodMemRetrieveMemories(**goodmem_kwargs),
]

tool_node = ToolNode(tools)
```

## 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 certs (default: `true`) |

## Example

A full ReAct agent example is in [examples/react_agent_with_memory.py](examples/react_agent_with_memory.py).

## License

MIT — see [LICENSE](LICENSE).
