Skip to main content

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 available
  • LISETTE_MODEL + LISETTE_API_KEY (or OPENAI_API_KEY)
  • JWT_SECRET (or JWT_AUTH_DISABLED=true for 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)

Source distribution for string-therapy 0.0.2
File Size Uploaded
string_therapy-0.0.2.tar.gz 37.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for string-therapy 0.0.2
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

0.1.0

2 release files

This release

0.0.2 This release

2 release files

0.0.1

2 release files

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