Skip to main content

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 once distilled; until then the write is in the raw tail
saved_tokens = pack.saved_tokens  # a coarse estimate vs raw history; small packs may round to 0

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

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.2.tar.gz (71.9 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.2-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: loregpt-0.1.2.tar.gz
  • Upload date:
  • Size: 71.9 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.2.tar.gz
Algorithm Hash digest
SHA256 547a5feadb20886bb880e65d2677b63ed126d19f47b96bf947077d25c0d62102
MD5 ec9f2b9c5085df0d7ae6c74f22f24fda
BLAKE2b-256 4b51b85bf5475dd81346d27d7b5a38e54f070b378eb7aa883a0ace7be9ce3422

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: loregpt-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 10.5 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6f9eb8690bcc4546676312cc01f64dcfcd4dd76dd838dda773e658c2dd5d33aa
MD5 fffd59489b116b67c2cd612f5b482c97
BLAKE2b-256 387822c0b2e8eb01e0378fcb3c6675f005de0e06d5efca9e989fdf86b67c2413

See more details on using hashes here.

Provenance

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

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 files

0.1.1

2 files

0.1.0

2 files

0.0.1

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page