Skip to main content

erubus (Python client)

Stdlib-only client for Erubus, a temporal knowledge graph for AI agents and robots. No dependencies.

pip install -e .          # or just copy erubus.py next to your code
python test_erubus.py     # unit tests (in-process HTTP stub; no server needed)
erubus serve &            # optional: live smoke tests run only if already up
from erubus import Erubus

kg = Erubus()                                  # http://127.0.0.1:8080
# Auth / namespace (optional; when set, sent on every request):
# kg = Erubus(token="abc123", ns="prod")       # Authorization: Bearer …, X-Erubus-Ns: …

kg.set_decay("vision:", half_life_secs=5)      # sensor beliefs go stale
kg.assert_fact("pallet-7", "at", "bay-3", confidence=0.9, source="vision:cam1")
# assert_fact defaults: confidence=1.0, source="python"; omit t → server stamps now

kg.value_at("pallet-7", "at")                  # t / known_at optional query params
# {'value': 'bay-3', 'effective_confidence': 0.87, 'server_time': ...}
# effective_confidence reflects set_decay half-lives (no separate decayed() call)

# What did the robot believe when it decided, not what was true:
kg.value_at("pallet-7", "at", t=20.0, known_at=decision_wall_clock)

kg.merge("bay 3", "Bay-03")                    # same entity, two spellings
kg.suggest_merge(q="bay 3")                    # fuzzy candidates (does not merge)
kg.context("pallet-7", depth=2)                # depth-bounded neighbourhood, not the whole reachable set
# context(root, depth=2, t=None): depth bounds nodes (server clamps to 4); no known_at

kg.set_schema("located_in", functional=True)   # schema registry
kg.get_schema()                                # {"relations": [...]}
kg.retention(86400)                            # drop closed edges older than 1d (server min 1h)
kg.backup("/tmp/erubus.db")                    # consistent snapshot → local file

for fact in kg.watch("pallet-7", reconnect=True):   # live SSE stream
    print(fact)

High-rate sensors should batch — one HTTP round-trip per fact is what makes a 30Hz loop expensive:

with kg.batch(max_size=256) as b:              # flushes at max_size and on exit
    for det in detections:
        b.add(det.id, "at", det.bay, confidence=det.score, source="vision:cam1")
# Or one-shot: kg.assert_facts([{...}, {...}]) → accepted count (or ErubusError)

Batches are all-or-nothing: if any fact is invalid (e.g. a clock-skewed timestamp or out-of-range confidence) the server rejects the whole batch, nothing lands, and the client raises ErubusError (not a partial success count), so retrying is safe.

All times are UTC epoch seconds — time.time() is already correct. Omit t and the server stamps it. Optional query params (t, known_at) are omitted from the wire when not passed — never sent as null. Writes with a timestamp far in the future are rejected; call kg.clock_skew() to check your clock against the server's.

Metadata

Release files for erubus 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for erubus 0.3.1
File Size Uploaded Provenance Actions
erubus-0.3.1.tar.gz 6.5 kB Without provenance Details for erubus-0.3.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for erubus 0.3.1
File Interpreter ABI Platform Actions
erubus-0.3.1-py3-none-any.whl Python 3 none any Details for erubus-0.3.1-py3-none-any.whl

Total release size: 13.4 kB

Release files / erubus-0.3.1.tar.gz

Download URL erubus-0.3.1.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c2786297f84bf049c9785be0f6251b3afb5528e253dc60ba147941e81a0c641e
BLAKE2b-256 checksum
How to use checksums
e7ffb1a369405f1add077d8965acb001dac8e4c019c555c2ce2b54c03bb80155
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Release files / erubus-0.3.1-py3-none-any.whl

Download URL erubus-0.3.1-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0d68390b5bc43c809784f056b9d1030ac4293f0d00ea035057c76e0e2d4f5e0b
BLAKE2b-256 checksum
How to use checksums
ec2c4d73ea53d1e33ed0d66b36c0f11012d8672a6a777c96516bcf6c9cd15616
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Security for erubus 0.3.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page