remem Python SDK
The official Python SDK for remem — the reasoning memory layer for AI agents.
Remem provides a persistent, queryable memory system that uses LLM-powered reasoning for importance scoring, contradiction detection, knowledge graph construction, and session consolidation. This SDK offers a strongly-typed, fully asynchronous interface over the remem REST API using httpx and pydantic.
Key Features
- Fully Asynchronous: Built natively on
asyncioandhttpx. - Type-Safe Models: Robust validation and autocompletion powered by Pydantic.
- LLM-Powered Reasoning: Effortlessly invoke semantic recall, importance scoring, and consolidation.
- Knowledge Graph: Native support for storing and querying relationship triples.
Installation
Install the package via pip or your preferred package manager (e.g., uv, poetry):
pip install rememhq
Quick Start
1. Start the remem API Server
Before using the SDK, start the rememhq-api server from the remem repository root:
cargo run -p rememhq-api -- --project default
By default, the server listens on http://localhost:7474.
2. Initialize the Client
import asyncio
from rememhq import Memory
async def main():
# Initialize the memory client
memory = Memory(
base_url="http://localhost:7474",
project="my-agent",
reasoning_model="claude-sonnet-4-6", # Configure the underlying reasoning engine
)
# Store a memory
store_resp = await memory.store(content="The user prefers Python for ML tasks.", tags=["preferences", "ml"])
print(f"Stored memory ID: {store_resp.id}")
# Recall memories using semantic reasoning
results = await memory.recall(query="What language does the user prefer for machine learning?", limit=5)
for result in results:
print(f"Content: {result.content}")
print(f"Reasoning trace: {result.reasoning}")
if __name__ == "__main__":
asyncio.run(main())
Configuration Options
You can configure the SDK using constructor parameters or environment variables:
memory = Memory(
base_url="http://localhost:7474",
project="my-agent",
reasoning_model="gpt-4o",
timeout=30.0,
)
Environment Variables:
REMEM_API_URL— API server URL (default:http://localhost:7474)REMEM_PROJECT— Target project namespace (default:default)REMEM_REASONING_MODEL— Reasoning model (default:claude-sonnet-4-6)REMEM_TIMEOUT— Request timeout in seconds (default:30)
API Reference
Memory Methods
store(content: str, tags: list[str] = None, importance: float = None) -> StoreResponse: Store a new memory.recall(query: str, limit: int = 8) -> list[RecallResult]: Retrieve contextually relevant memories utilizing LLM evaluation.search(query: str, limit: int = 10) -> list[SearchResult]: Execute rapid full-text/vector search.update(memory_id: str, content: str) -> UpdateResponse: Modify existing memory content.forget(memory_id: str) -> ForgetResponse: Delete a specific memory item.consolidate(session_id: str) -> ConsolidateResponse: Transform short-term session logs into long-term durable facts.
Development
To develop the SDK locally:
cd sdk/python
# Install dependencies (requires Python 3.11+)
pip install -e ".[dev]"
# Run tests
pytest tests/ -v
# Format and Lint
black rememhq/ tests/
ruff check rememhq/ tests/
Contributing
We welcome contributions! Please review our Contributing Guide for details on submitting pull requests, reporting issues, and suggesting enhancements.
License
This project is licensed under the Apache License 2.0. See the LICENSE file for more details.
Metadata
Release files for rememhq 0.1.18
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rememhq-0.1.18.tar.gz | 7.0 kB | With provenance | Details for rememhq-0.1.18.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rememhq-0.1.18-py3-none-any.whl | Python 3 | none | any | Details for rememhq-0.1.18-py3-none-any.whl |
Total release size: 14.4 kB
Release files / rememhq-0.1.18.tar.gz
| Download URL | rememhq-0.1.18.tar.gz |
|---|---|
| Size | 7.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
92389920275676f6157daf14790cefcdc7e1374637d85d4b231a9aaa3d9bf660
|
|
BLAKE2b-256 checksum How to use checksums |
4be97a37a09ea655d5037b9f00b4eed21dcdedfda669afeca3da57190fca0149
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 1, 2026.
Transparency logRelease files / rememhq-0.1.18-py3-none-any.whl
| Download URL | rememhq-0.1.18-py3-none-any.whl |
|---|---|
| Size | 7.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2b2b531050da46f41119340adeea3eb67f41927955393b72dce1915d28e3845d
|
|
BLAKE2b-256 checksum How to use checksums |
7b112fd1093f3ea20b0910d713a8e521e44e72cf515de1d7770d43034db5bcd2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 1, 2026.
Transparency logSecurity for rememhq 0.1.18
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for rememhq-0.1.18.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 1, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.