Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rememhq-0.1.5.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rememhq-0.1.5-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

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

Hashes for rememhq-0.1.5.tar.gz
Algorithm Hash digest
SHA256 bbe819b44d22938b4fcd41bc0a6de780e0616a62f3361df532d5934ce71145b5
MD5 50cf7dc64773752af2a9d90f8ff4c7ea
BLAKE2b-256 cc2c942182c621681f98575bd23923e73e0b2af788688ad7f6d425cf6248397d

See more details on using hashes here.

Provenance

The following attestation bundles were made for rememhq-0.1.5.tar.gz:

Publisher: publish.yml on remem-io/remem

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for rememhq-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 9ffba89a24e836868eb54ca575573e98b567862c319bc3ab586585cafe0f7944
MD5 8c7175eb55aa7b497887df4b2a95e83c
BLAKE2b-256 3848e40c5ad328113bb90b50ae783cac70128e97abdc68e462c91917ffc30546

See more details on using hashes here.

Provenance

The following attestation bundles were made for rememhq-0.1.5-py3-none-any.whl:

Publisher: publish.yml on remem-io/remem

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page