Skip to main content

Persistent memory infrastructure for AI agents

Project description

Remembr Python SDK

remembr is the official Python SDK for Remembr. It gives Python applications a typed async client for sessions, memory storage, search, checkpoints, export, and forget workflows.

Install

pip install remembr

EMBEDDING_PROVIDER=sentence_transformers is the default for bare installs, so you do not need a JINA_API_KEY just to get started locally.

Quick Start

import asyncio

from remembr import RemembrClient


async def main() -> None:
    async with RemembrClient(
        api_key="your-api-key",
        base_url="http://localhost:8000/api/v1",
    ) as client:
        session = await client.create_session(
            metadata={"user": "demo", "context": "support"}
        )

        await client.store(
            content="User prefers Friday billing summaries.",
            role="user",
            session_id=session.session_id,
            tags=["kind:preference", "topic:billing"],
        )

        results = await client.search(
            query="When should billing summaries be sent?",
            session_id=session.session_id,
            limit=5,
            search_mode="hybrid",
            weights={"semantic": 0.6, "keyword": 0.3, "recency": 0.1},
        )

        for memory in results.results:
            print(memory.content, memory.score)


asyncio.run(main())

Local Server Setup

git clone https://github.com/ai-emart/remembr.git
cd remembr
cp .env.example .env
python -c "import secrets; print(secrets.token_hex(32))"
# paste the generated value into SECRET_KEY in .env
bash scripts/docker-init.sh
curl http://localhost:8000/health

The Docker bootstrap flow works without Jina. For a plain Python install outside Docker, the default embedding backend is sentence_transformers.

Configuration

from remembr import RemembrClient

client = RemembrClient(
    api_key="your-api-key",
    base_url="http://localhost:8000/api/v1",
    timeout=30.0,
)

Environment Variables

Variable Purpose Required Default
REMEMBR_API_KEY Default API key for the client No None
REMEMBR_BASE_URL Default API base URL No http://localhost:8000/api/v1
EMBEDDING_PROVIDER Active embedding backend for self-hosted deployments No sentence_transformers
SENTENCE_TRANSFORMERS_MODEL Local sentence-transformers model No all-MiniLM-L6-v2
JINA_API_KEY Jina API key when using the Jina backend No None
OLLAMA_BASE_URL Ollama base URL when using the Ollama backend No http://localhost:11434
OPENAI_API_KEY OpenAI API key when using the OpenAI backend No None

Docs

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

remembr-0.2.0.tar.gz (20.7 kB view details)

Uploaded Source

Built Distribution

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

remembr-0.2.0-py3-none-any.whl (19.0 kB view details)

Uploaded Python 3

File details

Details for the file remembr-0.2.0.tar.gz.

File metadata

  • Download URL: remembr-0.2.0.tar.gz
  • Upload date:
  • Size: 20.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for remembr-0.2.0.tar.gz
Algorithm Hash digest
SHA256 5397487c3023a4e894d9d3403b2785bf97838c91d3285461e0f04ff62a1a38e8
MD5 aabd133065ed9d995f00022ae42a54b5
BLAKE2b-256 a0d417dd1b48d595b6b2e8fddaf5fb3f23d8ec9c6195c050a40ce08e405262de

See more details on using hashes here.

File details

Details for the file remembr-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: remembr-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 19.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for remembr-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aa3c8417aa13057d71500142825a2e3d724e4ad011e2cd5ea7835ad7f17c74ee
MD5 b225db74a05234eb1bbeea1fff505a7c
BLAKE2b-256 cbb62d73ed4eff00c0bcea7949a2c22db3b06e89a4d327bd6f0776cf6ef60192

See more details on using hashes here.

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