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.

Command line

pip install telonyte-brain
brain find "staging deploy" --deep

brain find <words> --deep asks the host for a deep result: a longer answer plus a checklist. --deep retry passes the host's retry mode when a short answer was not enough. If this host does not offer deep mode, the command prints a short notice and shows the normal result. brain --help lists the flags. brain --version prints the client version.

Module functions: status(), add(bot, text), find(q, n=5, bot=None, deep=None), 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.

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 0.2.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 telonyte-brain 0.2.1
File Size Uploaded Provenance Actions
telonyte_brain-0.2.1.tar.gz 83.5 kB Without provenance Details for telonyte_brain-0.2.1.tar.gz

Built distribution (wheel)

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

Total release size: 164.5 kB

Release files / telonyte_brain-0.2.1.tar.gz

Download URL telonyte_brain-0.2.1.tar.gz
Size 83.5 kB
Tags Source
SHA-256 checksum
How to use checksums
8b4d284cfa8ba20e3d3089f09a948bfed0e0cfda9490a44cecefa232ebb6c6a0
BLAKE2b-256 checksum
How to use checksums
6199ee7ba255832447f4744ed4e6f96f688b75486f5143663304a23ef9159882
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-0.2.1-py3-none-any.whl

Download URL telonyte_brain-0.2.1-py3-none-any.whl
Size 81.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0994c4dcd135b9fcd2b674aaa160a1aa132b6950751c76c3fa50e5d63fa39bb2
BLAKE2b-256 checksum
How to use checksums
406a2951ed57dd90a84f2edefc1ea7bdd02a0df22478023b1be3c7ee61ca566a
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 0.2.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