Skip to main content

Typed Python client for the Audrey LLM memory server

Project description

Audrey Python SDK

Typed Python client for the Audrey REST API.

Install

pip install audrey-memory

For local development from this repository:

cd python
python -m pip install -e .

Quick Start

Start Audrey's REST API:

npx audrey serve

Then use the client:

from audrey_memory import Audrey

brain = Audrey(
    base_url="http://127.0.0.1:7437",
    api_key="secret",
    agent="support-agent",
)

memory_id = brain.encode(
    "Stripe returns HTTP 429 above 100 req/s",
    source="direct-observation",
    tags=["stripe", "rate-limit"],
)

results = brain.recall("stripe rate limits", limit=5)
snapshot = brain.snapshot()
brain.close()

Restore snapshots only into an empty Audrey store, such as a sidecar started with a fresh AUDREY_DATA_DIR:

restore_target = Audrey(base_url="http://127.0.0.1:7437", api_key="secret")
restore_target.restore(snapshot)
restore_target.close()

Async usage:

import asyncio

from audrey_memory import AsyncAudrey


async def main() -> None:
    async with AsyncAudrey(base_url="http://127.0.0.1:7437") as brain:
        await brain.health()
        await brain.encode("Deploy failed due to OOM", source="direct-observation")
        await brain.recall("deploy failure", limit=3)


asyncio.run(main())

Features

  • Sync and async clients powered by httpx
  • Pydantic request and response models
  • Bearer auth via AUDREY_API_KEY
  • Optional X-Audrey-Agent header on client requests
  • Snapshot export and restore support

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

audrey_memory-0.23.1.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

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

audrey_memory-0.23.1-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file audrey_memory-0.23.1.tar.gz.

File metadata

  • Download URL: audrey_memory-0.23.1.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for audrey_memory-0.23.1.tar.gz
Algorithm Hash digest
SHA256 4b1fb4a8a6064c3121b03afbdf8a923b3677c459578479fd063e2ceb6e6ec948
MD5 d099bead50a73831e477f73823f79182
BLAKE2b-256 829edff62149f7559bbc2e773fa5f423b3ac6c8ad4a960cd4b558bab143fa86f

See more details on using hashes here.

File details

Details for the file audrey_memory-0.23.1-py3-none-any.whl.

File metadata

  • Download URL: audrey_memory-0.23.1-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for audrey_memory-0.23.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5da6a6ae3f4d5a78738d62d59cda06ffae95a3f208381474eb757a6a78f3df00
MD5 541951664ed1aac27653b25155e8768d
BLAKE2b-256 ddaa0c0845fa2b99dfaccd63f0caed7e50dd814abad4d1cc6e9ea53145b17d5e

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