Reasoning memory layer for AI agents — Python SDK
Project description
remem Python SDK
This is the Python SDK for remem, providing a typed interface over the REST API.
Installation
pip install rememhq
Quick Start
from rememhq import Memory
memory = Memory(base_url="http://localhost:7474")
# Store a memory
await memory.store("User prefers Python", tags=["language"])
# Recall memories
results = await memory.recall("what language does the user prefer?")
for result in results:
print(f"Content: {result.content}")
print(f"Reasoning: {result.reasoning}")
Development
Prerequisites
- Python 3.11+
- pip or uv
Setup
cd sdk/python
# Install in development mode with dev dependencies
pip install -e ".[dev]"
Testing
# Run all tests
pytest tests/ -v
# Run with coverage
pytest tests/ --cov=rememhq
# Run specific test
pytest tests/test_memory.py -v
Code Quality
# Format code
black rememhq/ tests/
# Lint
ruff check rememhq/ tests/
# Type checking
mypy rememhq/
Building
# Build distribution
python -m build
# Install locally from build
pip install dist/rememhq-*.whl
Running the API Server
Before using the SDK, start the remem API server from the repository root:
cargo run -p rememhq-api -- --project default
The API will be available at http://localhost:7474 by default.
API Reference
Memory
store(content: str, tags: Optional[List[str]] = None, importance: Optional[float] = None) -> StoreResponse
Store a memory with optional tags and importance score.
response = await memory.store(
"Production database is PostgreSQL 15",
tags=["infra", "database"],
importance=0.95
)
recall(query: str, limit: int = 8) -> List[RecallResult]
Retrieve memories most relevant to the query, with reasoning traces.
results = await memory.recall("what database are we using?", limit=8)
for result in results:
print(f"Content: {result.content}")
print(f"Score: {result.score}")
print(f"Reasoning: {result.reasoning}")
search(query: str, limit: int = 10) -> List[SearchResult]
Full-text search over all memories.
results = await memory.search("deployment", limit=10)
update(memory_id: str, content: str) -> UpdateResponse
Update an existing memory's content.
forget(memory_id: str) -> ForgetResponse
Delete a memory.
consolidate(session_id: str) -> ConsolidateResponse
Consolidate session logs into durable facts.
Configuration
Configure the SDK via constructor parameters or environment variables:
from rememhq import Memory
memory = Memory(
base_url="http://localhost:7474",
project="my-agent",
reasoning_model="claude-sonnet-4-6",
timeout=30.0
)
Environment variables:
REMEM_API_URL— API server URL (default:http://localhost:7474)REMEM_PROJECT— Project name (default:default)REMEM_REASONING_MODEL— Reasoning model (default:claude-sonnet-4-6)REMEM_TIMEOUT— Request timeout in seconds (default:30)
Examples
Check the examples/ directory for complete working scripts.
Contributing
See CONTRIBUTING.md for guidelines on contributing to the Python SDK.
License
Apache License 2.0 — See LICENSE for details.
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 rememhq-0.1.5.tar.gz.
File metadata
- Download URL: rememhq-0.1.5.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bbe819b44d22938b4fcd41bc0a6de780e0616a62f3361df532d5934ce71145b5
|
|
| MD5 |
50cf7dc64773752af2a9d90f8ff4c7ea
|
|
| BLAKE2b-256 |
cc2c942182c621681f98575bd23923e73e0b2af788688ad7f6d425cf6248397d
|
Provenance
The following attestation bundles were made for rememhq-0.1.5.tar.gz:
Publisher:
publish.yml on remem-io/remem
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rememhq-0.1.5.tar.gz -
Subject digest:
bbe819b44d22938b4fcd41bc0a6de780e0616a62f3361df532d5934ce71145b5 - Sigstore transparency entry: 2050879170
- Sigstore integration time:
-
Permalink:
remem-io/remem@e437f67663983fe5802b901f0a058cd22b364402 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/remem-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e437f67663983fe5802b901f0a058cd22b364402 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file rememhq-0.1.5-py3-none-any.whl.
File metadata
- Download URL: rememhq-0.1.5-py3-none-any.whl
- Upload date:
- Size: 6.6 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 |
9ffba89a24e836868eb54ca575573e98b567862c319bc3ab586585cafe0f7944
|
|
| MD5 |
8c7175eb55aa7b497887df4b2a95e83c
|
|
| BLAKE2b-256 |
3848e40c5ad328113bb90b50ae783cac70128e97abdc68e462c91917ffc30546
|
Provenance
The following attestation bundles were made for rememhq-0.1.5-py3-none-any.whl:
Publisher:
publish.yml on remem-io/remem
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rememhq-0.1.5-py3-none-any.whl -
Subject digest:
9ffba89a24e836868eb54ca575573e98b567862c319bc3ab586585cafe0f7944 - Sigstore transparency entry: 2050880590
- Sigstore integration time:
-
Permalink:
remem-io/remem@e437f67663983fe5802b901f0a058cd22b364402 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/remem-io
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e437f67663983fe5802b901f0a058cd22b364402 -
Trigger Event:
workflow_dispatch
-
Statement type: