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.1.tar.gz (71.7 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.1-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: loregpt-0.1.1.tar.gz
  • Upload date:
  • Size: 71.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for loregpt-0.1.1.tar.gz
Algorithm Hash digest
SHA256 855effbe27e845a1b5b0650b7aeac516dcd7b94ed7d6b21c262de6b50a01e4b2
MD5 73063d7d7dd57709a3a7272e28ec099e
BLAKE2b-256 c5c0026e1c58b5b6b4345edde68e98ed14a1a4bd4af5b4c5fe0a3774ba6301b0

See more details on using hashes here.

Provenance

The following attestation bundles were made for loregpt-0.1.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: loregpt-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for loregpt-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b5c6248afe6a74db0037beff2183aab88301da41b04ff9139a6e0c0ab2139137
MD5 4aea92498122b89fa4eb731b3cc337a4
BLAKE2b-256 0d65bf624b49ad918bb3f3173c7d61ed72a0faf5db9d80eebac95ef42158c6ff

See more details on using hashes here.

Provenance

The following attestation bundles were made for loregpt-0.1.1-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