Skip to main content

telonyte-brain

Python client for the B.R.A.I.N. V1 HTTP API. Standard library only, Python 3.9 or newer.

from telonyte_brain import add, find
add("my-bot", "NEW | The staging deploy runs on Fridays | team notes")
print("\n".join(find("staging deploy")["lines"]))

Set BRAIN_KEY and optionally BRAIN_URL. See the copy-paste examples on https://brain.telonyte.com/setup/api.

Module functions: status(), add(bot, text), find(q, n=5), delete(uid), hyper(), close(). For more than one key, or to choose where the local copy lives, use a client:

from telonyte_brain import Client
brain = Client(url=None, key=None, local=True, cache_dir=None, bot=None)
brain.find("staging deploy")
brain.hyper()["text"]   # "Hyper speed: on (local copy, synced 4s ago)"
brain.close()

Hyper speed

The first time you look something up, the package starts keeping a private copy of your team's memory on this computer and keeps it up to date in the background. After that, lookups are answered from that copy, in a few milliseconds, with the same results the host would give. Notes added from any computer show up here within a few seconds. If the copy cannot answer, the host does, so a lookup always works.

Every find answer carries mode (local or host) and reason, plus synced_ago_s when it came from the copy. hyper() returns {mode, reason, synced_ago_s, text}, for example:

  • Hyper speed: on (local copy, synced 4s ago)
  • Hyper speed: on (local copy, offline)
  • Hyper speed: off (using host: no local copy yet)
  • Hyper speed: off (using host: serverless or short-lived machine)

If you already run the brain command line tool with the same URL and key, its background helper answers instead, so nothing is kept twice.

The copy is stored in telonyte-brain/<id>/ under your cache folder (~/.cache, or %LOCALAPPDATA% on Windows), readable only by you, and encrypted at rest. It is removed if the key is revoked or the team is suspended, and it locks if the computer stays offline past the license window.

Meaning search. In the background the package also sets up the same optional local search model as the brain command line tool (a small model, bge-small, run in a private Python environment under the same cache folder; it needs numpy, onnxruntime and tokenizers, so the first setup downloads about 100 MB and runs once, even when several processes share the folder). Your notes stay on this computer. Until it is ready, and whenever it cannot answer in time, lookups use the built-in engine, so setup never slows or blocks a lookup. Answers can differ from the host's; the host stays the source of truth. Turn it off with BRAIN_EMBED=0 or by creating an empty file named off in <copy folder>/embed/.

Turn it off. Pass local=False to Client, or set BRAIN_LOCAL=0. Every call then goes to the host, as in earlier versions, and no folder is created.

Serverless and short-lived machines. On AWS Lambda, Vercel, Netlify, Google Cloud Functions and Run, Azure Functions and Deno Deploy the package detects it and uses the host, because a copy would be gone at the next start. The same happens when the cache folder cannot be written or this Python has no sqlite3 with FTS5. The local path never raises: any problem sends the question to the host.

Writes. add goes to the host. If the host cannot be reached, the note is saved in a small outbox on this computer, shows up in local lookups right away, and is sent later. Each note carries an id, so a resend never makes a second copy.

Background work runs in daemon threads that never keep your program alive. close() stops them; it also runs when the program exits.

Metadata

Release files for telonyte-brain 2.2.7

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

Source distribution (sdist)

Source distribution for telonyte-brain 2.2.7
File Size Uploaded Provenance Actions
telonyte_brain-2.2.7.tar.gz 93.1 kB Without provenance Details for telonyte_brain-2.2.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for telonyte-brain 2.2.7
File Interpreter ABI Platform Actions
telonyte_brain-2.2.7-py3-none-any.whl Python 3 none any Details for telonyte_brain-2.2.7-py3-none-any.whl

Total release size: 183.6 kB

Release files / telonyte_brain-2.2.7.tar.gz

Download URL telonyte_brain-2.2.7.tar.gz
Size 93.1 kB
Tags Source
SHA-256 checksum
How to use checksums
dbd7e129497b6f9c3ffa72e5526986221fee0ffbbc051506c3787c74bb2fc15c
BLAKE2b-256 checksum
How to use checksums
73cf3cb30bdbfdec5bedc3b360e056037907ed6804f9ac8af3778a22338a54af
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release files / telonyte_brain-2.2.7-py3-none-any.whl

Download URL telonyte_brain-2.2.7-py3-none-any.whl
Size 90.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a8835c274c1a3009d24139bac4f0d14c3aef37ce7f914b289c4cd6c4402b1efe
BLAKE2b-256 checksum
How to use checksums
070068176548c3a2f469f34ca24a26b22219bd14140d51eb4a1d28dd1a2df805
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Security for telonyte-brain 2.2.7

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