breeth
Official Python SDK for Breeth, the memory layer for agents.
breeth is a thin, type-safe wrapper around the Breeth REST API. It ships with both a synchronous and an asynchronous client, runs on Python 3.10+, and depends only on httpx and pydantic.
Install
pip install breeth
Quickstart (sync)
from breeth import BreethClient
with BreethClient(api_key="ck_live_...") as breeth:
# Write a memory
write_resp = breeth.write(
"Candidate Jane Doe has 4 years HR-tech experience at Workday.",
group_id="recruiting",
)
print(write_resp.episode_name, write_resp.extracted.entities)
# Retrieve
results = breeth.retrieve("HR-tech background", group_id="recruiting", limit=5)
for edge in results.edges:
print(edge.fact)
# Inspect an entity
entity = breeth.entity("Workday", mode="narrative")
# Browse the graph
nodes = breeth.graph.list_entities(query="Jane", limit=25)
edges = breeth.graph.list_edges(limit=50)
eps = breeth.graph.list_episodes()
details = breeth.graph.node_details(nodes.entities[0].uuid)
# List groups visible to the team
groups = breeth.groups()
Quickstart (async)
import asyncio
from breeth import AsyncBreethClient
async def main():
async with AsyncBreethClient(api_key="ck_live_...") as breeth:
await breeth.write("Recruiter prefers iterative sourcing.")
results = await breeth.retrieve("recruiter preferences")
print(results.edges)
asyncio.run(main())
Configuration
| Setting | Source |
|---|---|
| API key | api_key= argument, then BREETH_API_KEY env var, then COGRAM_API_KEY |
| Base URL | base_url= argument, then COGRAM_API_URL env var, default https://api.thebreeth.com |
| End user passthrough | end_user_id= argument, sent as X-End-User-Id |
Errors
Every non-2xx response is raised as a BreethError:
from breeth import BreethClient, BreethError
try:
with BreethClient(api_key="ck_live_...") as breeth:
breeth.write("...")
except BreethError as err:
print(err.status) # 429
print(err.slug) # "quota_exceeded"
print(err.message) # "Monthly write quota exceeded."
print(err.body) # raw JSON payload
The slug field is stable across API versions, so it is safe to branch on it.
Roadmap
- v0.1.0: sync + async clients for write, retrieve, entity, graph, groups.
- v0.2.0: NDJSON streaming endpoints (
/v1/graph/nodes,/v1/graph/links).
Links
- Product: https://thebreeth.com
- Docs: https://docs.thebreeth.com
- Issues: https://github.com/Gramies/cogram-sdk-python/issues
License
MIT. See LICENSE.
Metadata
Release files for breeth 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| breeth-0.1.0.tar.gz | 10.8 kB | Without provenance | Details for breeth-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| breeth-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for breeth-0.1.0-py3-none-any.whl |
Total release size: 21.0 kB
Release files / breeth-0.1.0.tar.gz
| Download URL | breeth-0.1.0.tar.gz |
|---|---|
| Size | 10.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e49d568aa5714af8622435378f81df804e0d03081af46650653c220ad2634ff5
|
|
BLAKE2b-256 checksum How to use checksums |
82c74ca78f52e76c586be66ae1adb047b18cf32740ae830f2892163b30c855d1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.19
|
Release files / breeth-0.1.0-py3-none-any.whl
| Download URL | breeth-0.1.0-py3-none-any.whl |
|---|---|
| Size | 10.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
38a5e5ccf3ec0b07d7ede074b8b88aff29a7e7b64a230061dd626bda36241d57
|
|
BLAKE2b-256 checksum How to use checksums |
04e56c8ceda770da50d496d33c132530959cceff0056a2a6d3503743408668c1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.19
|
Security for breeth 0.1.0
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.