Skip to main content

Python SDK for the Areev knowledge database — HTTP, gRPC, and MCP transports

Project description

Areev Python SDK

Python client library for the Areev knowledge database.

Installation

pip install areev

For gRPC transport:

pip install areev[grpc]

Quick Start

from areev import Areev

areev = Areev()  # reads AREEV_API_KEY, AREEV_URL from env
areev.remember("John likes coffee")

results = areev.recall("what does John like?")
for hit in results.results:
    print(f"  {hit.grain_type}: {hit.fields}")

Configuration

The client reads from environment variables by default:

Variable Default Description
AREEV_API_KEY API key (sent as Authorization: Bearer <key>)
AREEV_URL https://app.areev.ai Server endpoint
AREEV_MEMORY_ID default Memory database ID

Or pass them explicitly:

areev = Areev(api_key="ar_...", url="https://dub.areev.ai", memory_id="my-memory")

Async

from areev import AsyncAreev

async with AsyncAreev() as areev:
    await areev.remember("John likes coffee")
    results = await areev.recall("what does John like?")

API

Method Description
remember(text) Store natural-language memory (LLM extracts structure)
recall(query) Search memories
forget(hash) Delete a memory by hash
add(grain_type, **fields) Add a typed grain (low-level)
get(hash) Get a grain by hash
supersede(old_hash, grain_type, **fields) Update a grain
chat_interactive(slug, message, executors, ...) Harness chat with auto pause/resume for client:// tools
harness_chat(slug, req) Single harness turn (completed or requires_action)
chat_resume(slug, req) Resume a paused session with client-side tool outputs
cancel_chat_session(slug, session_id) Cancel a paused session (idempotent)
health() Health check
stats() Database statistics
flush() Flush write buffer

Low-Level Client

For advanced use cases (custom request objects, full async control):

from areev import HttpClient, AreevConfig, AddRequest, GrainType

config = AreevConfig(url="http://localhost:4009", memory_id="default", api_key="your-key")
async with HttpClient(config) as client:
    resp = await client.add(AddRequest(
        grain_type=GrainType.BELIEF,
        fields={"subject": "john", "relation": "likes", "object": "coffee"},
    ))

Harness Chat

Use chat_interactive to drive a harness (Areev's LLM-plus-tools runtime) with client-side tool executors. The helper runs the pause/resume loop for you when the model calls a client:// tool:

from areev import Areev

areev = Areev()

def get_weather(_name, args):
    city = args.get("city", "unknown")
    return {"city": city, "temp_c": 22, "conditions": "sunny"}

response = areev.chat_interactive(
    "weather-harness",
    "What's the weather in Paris?",
    executors={"get_weather": get_weather},
    conversation_id="conv-1",
)
print(response.text)

AsyncAreev exposes the same method as a coroutine. harness_chat, chat_resume, and cancel_chat_session are the low-level primitives if you want to run the loop yourself.

Transports

Transport Extra Status
HTTP/REST (default) Available
gRPC areev[grpc] Available
MCP Planned

Code Generation

Generate gRPC stubs and Pydantic models from the Areev spec:

pip install areev[dev]
./scripts/generate.sh

License

BUSL-1.1

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

areev-0.1.3.tar.gz (89.0 kB view details)

Uploaded Source

Built Distribution

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

areev-0.1.3-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file areev-0.1.3.tar.gz.

File metadata

  • Download URL: areev-0.1.3.tar.gz
  • Upload date:
  • Size: 89.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for areev-0.1.3.tar.gz
Algorithm Hash digest
SHA256 ab1be77a4bb034ad88a296010f5c11590408f77f8cf35f04cbe7b5c447e371d6
MD5 df3573951a268d21395bc1d964bffa3f
BLAKE2b-256 c4be2288864af691a2dec7ee98da805d05c2abf2286de920629acb29fa397284

See more details on using hashes here.

File details

Details for the file areev-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: areev-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for areev-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0ff54574c8153184c09fcf743bb8b9b566b05a30955f16a7455cbdf949c35368
MD5 8cea656360fe86c9789dc7995f9df0be
BLAKE2b-256 d075ed9d04ec7cf29e9bdcfaf8a86cb2db34e09e2895c53fd6638d305cdf4ae6

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