Public
TCall - Glyph-based session search engine
apiglyphminhashsearchsqlite
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
A tiny search engine over ephemeral sessions, powered by Glyph MinHash fingerprints and backed by SQLite.
Live API: https://tcall.val.run/
- Create a session with any name. Sessions expire after 5 minutes of inactivity; touching a live session (preserve/recall/create) extends it.
- Preserve aggregates a set of observations into a single Glyph collection glyph (period-min hash). Only that serialized glyph is stored — the raw observations are never written to the database.
- Recall rehydrates every preserved observation glyph, builds an in-memory index, searches it with a glyph of the query, and returns the raw context text for the top-
limithits.
Rendering mermaid diagram...
| Table | Columns | Purpose |
|---|---|---|
sessions | name, last_activity | Expiry (5 min inactivity) |
observations | id, session, glyph, context | Serialized collection glyph + raw context keyed to it |
All endpoints take JSON and return JSON.
{ "name": "meeting-notes" }
→ 200: { ok, session, expiresInSeconds, expiresAt }
{ "session": "meeting-notes", "observations": [ "the new pricing is $49 per seat for the pro tier", "annual plans get a 20% discount" ], "context": "Pricing decision: pro tier $49/seat, 20% off annual plans." }
observations are fingerprinted and discarded; only context is stored, keyed to the aggregated glyph. → 200: { ok, id }
{ "session": "meeting-notes", "query": "what did we decide about pricing?", "limit": 3 }
→ 200: { ok, query, total, results: [{ id, similarity, context }] }
- A session that is inactive for 5 minutes is wiped (observations deleted) and must be recreated. Sticky sessions (e.g.
test-notes) are exempt and never expire. - Recall uses an exact scan (
index.New({ mode: "direct" })); the default Softmax collection aggregator compares poorly against raw query glyphs, so TCall usesCollectionAggregatorMin. - Endpoint files: main.ts · lib.ts