Views
No views yet
A cento (Latin, "patchwork") is an ancient literary form: a complete new work composed entirely of verbatim lines borrowed from existing ones. In the 4th century, Proba wrote the Cento Vergilianus — a new story assembled only from Virgil's exact lines. Cento does the same with a memory: it weaves a new, coherent, on-topic response using only what is already there. Nothing is invented. The constraint is the integrity.
corpus ──► fragments + legality oracle (every real trigram / sentence boundary)
│
query ──► relevance (keyword + embedding) ──► BEAM SEARCH over fragments,
joined only at corpus-licensed seams ──► VALIDATE (all-verbatim) ──► replyCento (the thinking — bounded, grounded, hallucination-free)
└─► injected into an LLM's reasoning channel ─► the LLM speaks, grounded in real memory<think>-channel injection, is straightforward; see the demo and src/session.js.)$ node demo/cento.js demo/walden "What is solitude to you?"
But for the most part it is as solitary where I live as on the prairies. The
greater part of what my neighbors call good I believe in my soul to be bad, and
if I repent of anything, it is very likely to be my good behavior.
· 48 words · 95.7% of trigrams verbatim from corpus ·
$ node demo/cento.js demo/walden "Tell me about the morning."
Morning is when I am awake and there is a dawn in me. A morning-glory at my
window satisfies me more than the metaphysics of books.
· 92.2% verbatim ·1# requires Node >= 18, and (for semantic recall) Python with sentence-transformers
2pip install sentence-transformers # the MiniLM ear (Apache-2.0); omit for keyword-only mode
3node demo/build-corpus.js # weave the public-domain Walden demo
4node demo/cento.js demo/walden # talk to itcorpus.jsonl — one JSON object per line: {"prompt": "...", "reply": "..."} (prompt optional). The reply text is the entity's voice — everything it can ever say is woven from these.voiceprint.json — {"name": "...", "lengthByStimulus": { ... }} (name required).node demo/cento.js path/to/entity "your message".src/compose.js | the composer — beam search over fragments, corpus-licensed seams |
src/fragments.js | fragmenter + the legality oracle + the bounded validator |
src/semantic.js | the MiniLM embedding bridge (ranking only) + embed.py |
src/relevance.js | keyword relevance + query bucketing |
src/recall.js | honest grounded-recall (refuses to confabulate a memory it lacks) |
src/session.js | multi-turn state (running memory, cross-turn no-repeat, growth) |
src/flow.js, src/hebbian.js | trajectory composition + associative weighting |
demo/ | the public-domain Walden demo + a clean CLI |
corpus/ | public-domain source texts (Thoreau, Whitman, Anderson, Lomax) |