Skip to main content

Python SDK for Lore — coordination memory for multi-agent AI systems: create runs, write events, and fetch read-your-writes context packs.

Project description

loregpt

Python SDK for Lore — the open-source coordination memory layer for multi-agent AI systems. Create runs, write events, and fetch read-your-writes context packs.

🚧 Pre-release. Lore is building in the open toward v0.1; this SDK tracks the live API.

Compatibility. SDK 0.1.x targets the Lore v1 API (server ≥ 0.0.1). The SDK and the server version independently — match on the API version, not the release number.

Install

pip install loregpt

Requires Python 3.10+. One dependency, httpx, for connection pooling and a shared sync/async transport — the de-facto standard of the AI-Python ecosystem.

Usage

lore = LoreClient(api_key=api_key)

run = lore.create_run()
result = lore.write(
    run_id=run.run_id,
    agent_id="researcher",
    content="Auth flow moved to v2 - PR #42 merged",
)

pack = lore.pack(
    run_id=run.run_id,
    query="current state of auth work",
    scopes={"team": "platform"},
    min_seq=result.seq,
    token_budget=2000,
)

covered_seq = pack.covered_seq  # >= result.seq -> read-your-writes, guaranteed
saved_tokens = pack.saved_tokens  # estimated tokens saved by packing

write takes exactly one of content (a string, wrapped as {"content": ...}) or payload (an opaque dict); write_state(run_id=..., agent_id=..., entity=..., predicate=..., value=...) writes one working-memory fact seen immediately by a same-run reader.

Async

AsyncLoreClient has the same methods with await:

async with AsyncLoreClient(api_key=api_key) as lore:
    run = await lore.create_run()
    result = await lore.write(run_id=run.run_id, agent_id="researcher", content="hello")
    pack = await lore.pack(run_id=run.run_id, query="state of work", min_seq=result.seq)

Errors

Every failure raises a LoreError. Server errors carry the machine code (discriminate on the class or .code, never string-match) and .http_status; transport and parse failures are distinct classes. Requests are not retried (a write is not idempotent) — a failure surfaces so the caller decides.

from loregpt import LoreError, NotFoundError

try:
    pack = lore.pack(run_id=run_id, query="...", min_seq=999)
except NotFoundError:
    ...  # unknown run, or not this key's project
except LoreError as err:
    print(err.code)  # e.g. "min_seq_out_of_range", "model_mismatch", "unauthorized", "connection"

LoreClient(api_key, *, base_url="http://localhost:8080", timeout=..., headers=..., transport=...) — pass a custom httpx transport for a proxy, instrumentation, or tests.

License: Apache-2.0

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

loregpt-0.1.0.tar.gz (71.2 kB view details)

Uploaded Source

Built Distribution

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

loregpt-0.1.0-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file loregpt-0.1.0.tar.gz.

File metadata

  • Download URL: loregpt-0.1.0.tar.gz
  • Upload date:
  • Size: 71.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for loregpt-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b43256a10c82d5b3c55d026f1def97d22ba1fc00fc6c4e344a1d47483d4dcd02
MD5 da5f7384d0fa682e00c886b3f907529b
BLAKE2b-256 84ca1aa693610b66666dad4c8090d89445b105c63b347bef68b0a330053ef8c8

See more details on using hashes here.

Provenance

The following attestation bundles were made for loregpt-0.1.0.tar.gz:

Publisher: release-sdk.yml on lore-gpt/lore

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

File details

Details for the file loregpt-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: loregpt-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for loregpt-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1b299c0ed81861c640ed4cecc23b12099cedefa5b20dda2cb75eef06e8657168
MD5 9511d6db420d99953092c9fc1e51e7b7
BLAKE2b-256 573d6b9564ddf94e24ee50d4f4a2dfcb06dbdaa2242e0c8ccece0721d80f8a32

See more details on using hashes here.

Provenance

The following attestation bundles were made for loregpt-0.1.0-py3-none-any.whl:

Publisher: release-sdk.yml on lore-gpt/lore

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