ASK-LATTICE-v1
Single-file cognitive lattice: dictionary enrichment β concurrent OSINT fan β engram memory β LLM stages β live canvas field
The entire model runs in one html file, it can achieve around 200 tokens/second in a browser alone. No GPU, No Attention matrices.
Download the full model in the repo: https://huggingface.co/webxos/ask-lattice-v1/blob/main/ask-lattice-v1.html
Try it free and hosted at: https://agentowl.netlify.app/asklattice
Part of the OWL family of models: https://agentowl.netlify.app for more info.
webXOS 2026 webxos.netlify.app
How it works
The pipeline runs in nine stages with cancellation checked at every await boundary. Tokenization sanitizes the prompt (400-char cap, max 12 unique non-stopword tokens). Dictionary enrichment resolves words in chunks of four within a 12-second budget, using an in-flight dedupe map so concurrent callers of the same word share one fetch. The OSINT fan queries Semantic Scholar, OpenAlex, Stack Exchange, Wikipedia, DuckDuckGo, and Open Library in parallel with per-source timeouts, ranks hits by source weight, position decay, and prompt-term overlap, and gates each source behind a circuit breaker. Engram recall scans the e: namespace for prompts with β₯0.20 word overlap. LLM stages try a session-only endpoint first, falling back to a local synthesizer that builds a plan and essay from real run data. A streamed draft pushes tokens into the live field, and the run is committed back to engram memory.
Storage is two-tier: an in-memory LRU (256 entries) backed by IndexedDB (qfm-store β kv). TTLs are key-prefix aware β engrams 30 days, LLM cache 3 days, positive dictionary entries 7 days, and negative entries just 5 minutes. Negative entries are IDB-only and never promoted into the LRU, and offline runs never write dictionary entries at all. Every IndexedDB operation is deadline-guarded at 1.5 seconds so a stalled database can never hang the pipeline.
The circuit breaker distinguishes two failure modes: recoverable failures (HTTP errors, timeouts) trip after 3 strikes for a 45-second cooldown, while TypeError from fetch β meaning CORS or network unreachability β is classified as unsupported and pinned for 10 minutes. Breaker reads (isTripped, getFanHealth) are pure and never reset state. The render loop wraps all drawing in try/catch/finally and unconditionally reschedules requestAnimationFrame, so a thrown draw error can never kill rendering. Progress and fault notes share one line with a severity guard: a lower-severity note can never overwrite an active failure, and finish()/cancel() restore active warn/fail notes rather than stomping them.
Pipeline
- Tokenize β extract up to 12 content words.
- Dict enrich β resolve each word via dictionaryapi.dev.
- OSINT fan β query 6 keyless sources concurrently (Semantic Scholar, OpenAlex, Stack Exchange, Wikipedia, DuckDuckGo, Open Library).
- Engram recall β pull related prior prompts from IndexedDB.
- LLM stages β
preplan, streamed draft, optionalpostDEEP essay. Uses an optional keyless endpoint or a local synthesiser. - Visualize β live lattice field + activity waveform.
- Commit β store the run as an engram for future recall.
Every network call is timeout-bounded. Every source is breaker-gated. The render loop is structurally unkillable.
Caching
Two layers: in-memory LRU (256 entries) + IndexedDB (qfm-store / kv).
| Key | TTL | Layer |
|---|---|---|
e: (engram) |
30 days | Both |
llm: |
3 days | Both, stage-aware cap |
w: negative |
5 minutes | IDB-only |
w: positive |
7 days | Both |
Negative entries never enter the LRU. Offline runs never write w: entries. Truncated post LLM cache hits are refused.
Circuit breaker
Per source (including dict):
- 3 fails β 45 s cooldown.
TypeError(CORS/network) β 10 min trip, statusUNSUPPORTED.- Health checks are read-only β no state reset on read.
Fix series
| Fix | Summary |
|---|---|
| N-1 | Negative-cache TTL (5 min, both layers, IDB-only, no offline writes) |
| N-2 | arxiv removed (no CORS); TypeError β 10-min unsupported trip |
| N-3 | Render loop unkillable via try/catch/finally |
| N-4 | In-flight dedupe race parity for secondary callers |
| N-5 | Stage-aware LLM cache caps; truncated post hits refused |
| N-6 | Progress/note severity guarding |
| N-7 | Accessibility attributes on prompt, buttons, canvases |
Hygiene: (a) single-slice draft snapshot Β· (b) read-only breaker health Β· (c) matchMedia Safari fallback.
JS API
QFM.version
QFM.dumpState()
QFM.Pipeline.run('prompt')
QFM.Pipeline.cancel()
await QFM.resolveWord('word')
await QFM.rankedOsintFan('query')
QFM.getFanHealth()
Browser support
Chrome/Edge 88+ Β· Firefox 85+ Β· Safari 14+ Β· Opera 74+ Β· mobile equivalents.
Requires: fetch, Promise, Map/Set, IndexedDB, requestAnimationFrame, AbortController.
Limitations
No backend. CORS-dependent sources. 12-word / 400-char prompt caps. English-only dictionary. LLM endpoint session-only. IDB unavailable in private browsing β memory-only session.
License
MIT Β© 2025 "Quantum Frequency Modulation for next token prediction" by webXOS 2026 webxos.netlify.app - github.com/webxos