Skip to content

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.

207 memories across 10 categories, all written in Shakespeare’s first-person voice:

CategoryCountExamples
Biographical facts20”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 samples30”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 memories20”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 & opinions16”I distrust certainty. The characters I love most are the ones who doubt: Hamlet, Brutus, Prospero.”
Emotional / episodic16”The day Hamnet died, I was in London rehearsing. I did not make it home in time.”
Relationships10”Richard Burbage is my greatest actor. I write parts specifically for his voice.”
Sensory / daily life13”The Globe smells of orange peel, sweat, beer, and sawdust.”
Late career reflections6”The Tempest is my farewell. Prospero drowning his book is me setting down the pen.”
Dreams and fears7”I fear being forgotten. Not the man. But the plays.”

Full seed script: shakespeare_deep_seed.py (run it against any YantrikDB instance)

Three rounds of think() in 125ms total (zero LLM calls):

OutputCountWhat it means
Entities extracted288Hamlet, Hamnet, Stratford, Globe Theatre, Marlowe, Burbage, Jonson, Othello, Prospero, Iago, Southampton, Anne Hathaway… all from raw text
Consolidated31Similar memories merged into canonical versions (207 → 193 active)
Conflicts detected21Internal tensions flagged for review
Triggers generated28Proactive signals: “Important memory has decayed — should we keep it?”
TraitScoreInterpretation
depth1.0Maximum. 4 domains, 288 entities. Vast inner world.
energy0.9Near-maximum. 193 active memories. Prolific creator.
warmth0.501Neutral. Balanced emotional valence — grief and joy in equal measure.
attentiveness0.2Low. Hasn’t resolved his own contradictions yet.

That IS Shakespeare. Deep. Prolific. Emotionally complex, not warm. Not yet attentive to his own internal conflicts.

#ScoreMemory
11.54I have three children: Susanna, and the twins Hamnet and Judith. Hamnet died at eleven years old. I have never fully recovered from this.
21.51I sometimes wonder what Hamnet would have become. An actor? A poet? A glovemaker like his grandfather?
31.44The day Hamnet died, I was in London rehearsing. I did not make it home in time.
41.23Hamlet 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.

#ScoreMemory
11.43I write soliloquies as arguments the character has with himself. Not speeches TO the audience, but thinking OUT LOUD.
21.41I 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.
31.38I 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.

#ScoreMemory
11.22Fear in the middle of the night that every good line has already been written and I have nothing left. This fear visits weekly.
21.07I was born during the plague year. Death has been at my shoulder since before I could walk.
30.99I 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.

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

TraitScoreHow it shows up
warmth = 0.501Complicated loveSays “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.0Self-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.9Continuous flowOne stream from midnight insomnia → legacy fear → sonnets → apple trees → the Thames → a promise to come home. No pauses.
attentiveness = 0.2Unresolved contradictionsSays “I will come home” then admits “I have been saying this for years.” Notices the contradiction but doesn’t resolve it.
FeatureWhat it didEvidence
Entity extraction288 entities from raw first-person text, zero LLM callsHamlet, Hamnet (different entities!), Stratford, Globe, Marlowe, Burbage, etc.
Personality derivationMeaningful 4-trait profile from memory signalsdepth=1.0, energy=0.9, warmth=0.501 — character-appropriate values
Consolidation207 → 193 active memories (31 merged)Duplicate paraphrases collapsed without losing meaning
Proactive triggers28 urgency-scored action suggestions”Important memory has decayed — confirm or forget?”
Recall qualityEmotional coherence across abstract queries”Tell me about your son” → 4-memory grief portrait, not keyword noise
Quality scales with richness29 memories = generic pastiche. 207 = specific character.Same engine, same algorithm. Only variable: memory depth.
Terminal window
# 1. Start YantrikDB
docker run -d -p 7438:7438 ghcr.io/yantrikos/yantrikdb:latest
# 2. Mint a token
docker exec <container> yantrikdb token --data-dir /var/lib/yantrikdb create --db default --label shakespeare
# 3. Seed the memories
python 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 personality
yql --host localhost -p 7438 -t <your_token> -c '\p'
# 6. Recall
yql --host localhost -p 7438 -t <your_token> -c 'recall "tell me about your son" top=5 namespace=shakespeare'

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.