string_therapy
JWT-gated LLM controller that routes messages over PostgreSQL + Apache AGE and forwards to downstream HTTP endpoints
string_therapy is a FastHTML service: Lisette browses category/endpoint strings from an AGE routing graph (ACL-filtered by JWT), or routes and forward_tools when the user is ready — asking for any missing required parameters first.
Quickstart
Install
pip install string-therapy
# or editable: pip install -e .
# or from git: pip install git+https://github.com/alix559/string_therapy.git
Configure
Copy .env.example to .env and set at least:
ROUTER_DATABASE_URL— Postgres DSN with Apache AGE availableLISETTE_MODEL+LISETTE_API_KEY(orOPENAI_API_KEY)JWT_SECRET(orJWT_AUTH_DISABLED=truefor local dev)
Schema → seed → serve
string-therapy-ensure-schema
string-therapy-seed --graph examples/router_graph.json
string-therapy-serve
Or in Python:
from string_therapy import ensure_schema, seed_router_db, create_app, serve_controller
ensure_schema()
seed_router_db('examples/router_graph.json')
serve_controller() # or: app = create_app()
Call the API
curl -s http://127.0.0.1:5011/health
curl -s http://127.0.0.1:5011/controller \
-H 'Authorization: Bearer <jwt>' \
-H 'Content-Type: application/json' \
-d '{"message": "run a sales report"}'
JWT claims: sub (required), optional roles / groups. Those map to ACL principals like role:analyst.
Router graph JSON
See examples/router_graph.json (also packaged under string_therapy/examples/). Nodes are categories or endpoints with intent (stable key) and name (display label); edges are SERVES; optional acl rows set (node_id, principal, permission).
Example notebook
Walk through the library interactively:
jupyter notebook examples/getting_started.ipynb
Developer Guide
This project uses nbdev. Edit notebooks under nbs/, then:
pip install -e ".[dev]"
nbdev_prepare
pytest -q
Documentation
Metadata
Release files for string-therapy 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| string_therapy-0.0.2.tar.gz | 37.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| string_therapy-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 73.3 kB
Release files / string_therapy-0.0.2.tar.gz
| Download URL | string_therapy-0.0.2.tar.gz |
|---|---|
| Size | 37.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4b9b6240818ddbdcbbe07e6a27c4dc37af5872bda29f13a6f062cbbd99927691
|
|
BLAKE2b-256 checksum How to use checksums |
e29eb42d9fc47ec7b5cedb6bb9e6fcd22e117a7bc7811272ed19863b8b7ac65c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Release files / string_therapy-0.0.2-py3-none-any.whl
| Download URL | string_therapy-0.0.2-py3-none-any.whl |
|---|---|
| Size | 36.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c4e8c9e43f6eb7aa3c937338b3d24a4f0ef0692677a6086f0698b1a47c93203e
|
|
BLAKE2b-256 checksum How to use checksums |
110f284e930db6cd31ae1712603b565a6d665425b4abb7d3aa45bcdf5b00a63b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|