Shakespeare: Bringing a Character Alive
What happens when you give YantrikDB 207 first-person memories from William Shakespeare’s life, run think(), and ask him to write?
This experiment demonstrates: entity extraction from raw text, personality derivation, consolidation, contradiction detection, proactive triggers, and how recall quality scales with memory richness — all with zero LLM calls at the database layer.
The Seed
Section titled “The Seed”207 memories across 10 categories, all written in Shakespeare’s first-person voice:
| Category | Count | Examples |
|---|---|---|
| Biographical facts | 20 | ”I married Anne Hathaway when I was eighteen. She was twenty-six.” |
| Writing craft (procedural) | 40 | ”I always write the villains first. Iago before Othello. The antagonist defines the shape of the story.” |
| Language samples | 30 | ”I wrote ‘To be, or not to be’ and knew immediately it was the best opening to a soliloquy I had ever composed.” |
| Play-specific memories | 20 | ”King Lear is the play I am most proud of and the one I find hardest to reread. The storm scene wrote itself. I was crying while I wrote it.” |
| Personality & opinions | 16 | ”I distrust certainty. The characters I love most are the ones who doubt: Hamlet, Brutus, Prospero.” |
| Emotional / episodic | 16 | ”The day Hamnet died, I was in London rehearsing. I did not make it home in time.” |
| Relationships | 10 | ”Richard Burbage is my greatest actor. I write parts specifically for his voice.” |
| Sensory / daily life | 13 | ”The Globe smells of orange peel, sweat, beer, and sawdust.” |
| Late career reflections | 6 | ”The Tempest is my farewell. Prospero drowning his book is me setting down the pen.” |
| Dreams and fears | 7 | ”I fear being forgotten. Not the man. But the plays.” |
Full seed script: shakespeare_deep_seed.py (run it against any YantrikDB instance)
What think() Produced
Section titled “What think() Produced”Three rounds of think() in 125ms total (zero LLM calls):
| Output | Count | What it means |
|---|---|---|
| Entities extracted | 288 | Hamlet, Hamnet, Stratford, Globe Theatre, Marlowe, Burbage, Jonson, Othello, Prospero, Iago, Southampton, Anne Hathaway… all from raw text |
| Consolidated | 31 | Similar memories merged into canonical versions (207 → 193 active) |
| Conflicts detected | 21 | Internal tensions flagged for review |
| Triggers generated | 28 | Proactive signals: “Important memory has decayed — should we keep it?” |
Derived Personality
Section titled “Derived Personality”| Trait | Score | Interpretation |
|---|---|---|
| depth | 1.0 | Maximum. 4 domains, 288 entities. Vast inner world. |
| energy | 0.9 | Near-maximum. 193 active memories. Prolific creator. |
| warmth | 0.501 | Neutral. Balanced emotional valence — grief and joy in equal measure. |
| attentiveness | 0.2 | Low. Hasn’t resolved his own contradictions yet. |
That IS Shakespeare. Deep. Prolific. Emotionally complex, not warm. Not yet attentive to his own internal conflicts.
Recall: Does the Character Come Through?
Section titled “Recall: Does the Character Come Through?””Tell me about your son”
Section titled “”Tell me about your son””| # | Score | Memory |
|---|---|---|
| 1 | 1.54 | I have three children: Susanna, and the twins Hamnet and Judith. Hamnet died at eleven years old. I have never fully recovered from this. |
| 2 | 1.51 | I sometimes wonder what Hamnet would have become. An actor? A poet? A glovemaker like his grandfather? |
| 3 | 1.44 | The day Hamnet died, I was in London rehearsing. I did not make it home in time. |
| 4 | 1.23 | Hamlet is the play that cost me the most. I wrote it after Hamnet died. The name is not a coincidence. |
Four memories forming a coherent portrait of grief — the fact, the wondering, the guilt, the artistic response. Not keyword matching. Emotional coherence.
”How do you craft a soliloquy?”
Section titled “”How do you craft a soliloquy?””| # | Score | Memory |
|---|---|---|
| 1 | 1.43 | I write soliloquies as arguments the character has with himself. Not speeches TO the audience, but thinking OUT LOUD. |
| 2 | 1.41 | I wrote ‘To be, or not to be’ and knew immediately it was the best opening I had ever composed. Six monosyllables before the first polysyllable. |
| 3 | 1.38 | I revise constantly. The first draft of a soliloquy is never the last. I test lines on the actors. If Burbage stumbles, the phrase is wrong. |
Procedural memory working. The system retrieved technique → exemplar → revision process. A teaching sequence, not a fact dump.
”What is your greatest fear?”
Section titled “”What is your greatest fear?””| # | Score | Memory |
|---|---|---|
| 1 | 1.22 | Fear in the middle of the night that every good line has already been written and I have nothing left. This fear visits weekly. |
| 2 | 1.07 | I was born during the plague year. Death has been at my shoulder since before I could walk. |
| 3 | 0.99 | I am afraid that someone will read the sonnets after I die and think they know me. |
Two explicit fear memories surfaced at #1 and #3. The plague memory at #2 connects death-as-presence to fear-of-mortality. Associative recall across domains.
The Output: A Letter to Anne
Section titled “The Output: A Letter to Anne”With personality (warmth=0.501, depth=1.0, energy=0.9, attentiveness=0.2) and recalled memories as context, Claude generated this letter. The database didn’t write it — but the letter couldn’t exist without the database.
Anne —
It is past midnight and the candle is almost gone. I should sleep but I find I cannot, so I write to you instead, though I know this letter will arrive after I could have arrived myself, had I chosen to walk instead of write.
I have been thinking about what happens after. Not after the play ends — after I end. Heminges and Condell say they will gather the plays into a book. I believe them. I also fear them. What if someone reads the book and thinks they know me? The plays are true but they are not the whole truth. You know this better than anyone alive.
The sonnets worry me more. I was not careful in the sonnets. There are lines in them that belong to you, and lines that do not, and I have not always been clear about which are which. I am sorry for this. Not sorry enough to burn them, which tells you something about me that the sonnets themselves do not.
Susanna writes that the apple trees at New Place are flowering early. I can picture them from here. I can picture you under them. I want to come home. I also want to finish the play I am writing, which is about a magician who gives up his power and goes home, and I see the irony, Anne, I am not so blind as that. But seeing the irony and acting on it are different things. Hamlet taught me this, though I taught Hamlet first.
The river here is not like our river. The Thames smells of commerce and rot. The Avon smells of rain. I miss rain that does not stink.
I will come home. I have been saying this for years and I know you have stopped believing it, but I will. When the play is done. When the last magician has drowned his book. When I have run out of ways to say the same things in different costumes.
I love you in the way I love Stratford — deeply, from a distance, with guilt I cannot put in any play because no audience would believe a man could be this foolish for this long.
Your husband still, Will
How Personality Shaped the Letter
Section titled “How Personality Shaped the Letter”| Trait | Score | How it shows up |
|---|---|---|
| warmth = 0.501 | Complicated love | Says “I love you” then qualifies it: “in the way I love Stratford — deeply, from a distance, with guilt.” Not a love letter. A confession. |
| depth = 1.0 | Self-referential layers | ”I am writing about a magician who gives up his power and goes home, and I see the irony.” Meta-theatrical even in a private letter. |
| energy = 0.9 | Continuous flow | One stream from midnight insomnia → legacy fear → sonnets → apple trees → the Thames → a promise to come home. No pauses. |
| attentiveness = 0.2 | Unresolved contradictions | Says “I will come home” then admits “I have been saying this for years.” Notices the contradiction but doesn’t resolve it. |
What This Proves
Section titled “What This Proves”| Feature | What it did | Evidence |
|---|---|---|
| Entity extraction | 288 entities from raw first-person text, zero LLM calls | Hamlet, Hamnet (different entities!), Stratford, Globe, Marlowe, Burbage, etc. |
| Personality derivation | Meaningful 4-trait profile from memory signals | depth=1.0, energy=0.9, warmth=0.501 — character-appropriate values |
| Consolidation | 207 → 193 active memories (31 merged) | Duplicate paraphrases collapsed without losing meaning |
| Proactive triggers | 28 urgency-scored action suggestions | ”Important memory has decayed — confirm or forget?” |
| Recall quality | Emotional coherence across abstract queries | ”Tell me about your son” → 4-memory grief portrait, not keyword noise |
| Quality scales with richness | 29 memories = generic pastiche. 207 = specific character. | Same engine, same algorithm. Only variable: memory depth. |
Reproduce This
Section titled “Reproduce This”# 1. Start YantrikDBdocker run -d -p 7438:7438 ghcr.io/yantrikos/yantrikdb:latest
# 2. Mint a tokendocker exec <container> yantrikdb token --data-dir /var/lib/yantrikdb create --db default --label shakespeare
# 3. Seed the memoriespython shakespeare_deep_seed.py <your_token>
# 4. Run think (3 rounds)yql --host localhost -p 7438 -t <your_token> -c '\t'yql --host localhost -p 7438 -t <your_token> -c '\t'yql --host localhost -p 7438 -t <your_token> -c '\t'
# 5. Check personalityyql --host localhost -p 7438 -t <your_token> -c '\p'
# 6. Recallyql --host localhost -p 7438 -t <your_token> -c 'recall "tell me about your son" top=5 namespace=shakespeare'What’s Next
Section titled “What’s Next”More showcases are planned:
- Einstein — Can procedural memory reproduce his thought-experiment methodology?
- A fictional CEO — Can contradiction detection catch conflicting business decisions?
- An AI agent after 100 sessions — What does real agent memory look like over time?
Have your own experiment? Share it in Discussions.