{"slug": "i-held-a-seance-with-edgar-allan-poe-he-may-only-speak-through-his-own-books", "title": "I held a séance with Edgar Allan Poe. He may only speak through his own books.", "summary": "A developer built Bookshelf Séance, an open-source tool that ingests a user's EPUB library and lets them ask questions of a chosen author, with the ghost answering in the first person using only passages from that author's own books, each cited by book, chapter and sentence. The system ranks an author's passages against the question using a from-scratch BM25 implementation, then prompts a local model via Ollama (gemma4:e2b in the demo) to answer only from those passages; if no passage scores high enough, the model is never called and the tool replies \"The spirits are silent on this.\" The demo, run on a 2-core CPU-only GitHub Actions runner, completed three questions in 44 seconds using only the Python standard library.", "body_md": "*This is a submission for the [Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine](https://dev.to/challenges/hacktoberfest-week4-2026-10-26)*\n\n**Bookshelf Séance** lets you talk with the dead authors on your own bookshelf.\n\nYou point it at your EPUB library. You summon an author, say \"Edgar Allan Poe\". You ask a question. The ghost answers in the first person.\n\nThere is one rule: the ghost may speak **only through passages from its own books**, and it must cite them. Under every answer you get the book, the chapter and the sentence it used, so you can check it.\n\nAnd if the books say nothing on the subject, the ghost does not make something up. It says:\n\n```\nThe spirits are silent on this.\n```\n\nThat is how I read the theme. A ghost that says what it never said is not a ghost. It is a puppet. Honoring the dead means not putting words in their mouths.\n\nIt is for readers with a library of EPUBs: public-domain classics, out-of-print books, maybe a scanned diary or family letters turned into an ebook. Things you would rather not upload anywhere.\n\n``` bash\n$ bash docs/demo.sh\nBookshelf Seance demo, model gemma4:e2b, Ollama at http://localhost:11434\n\nWrote /tmp/tmp.kqnRXGqRSW/poe-tales.epub (3 tales by Edgar Allan Poe)\nIngested \"Three Tales of Terror\" by Edgar Allan Poe: 3 chapters, 53 passages\nIndex: /tmp/tmp.kqnRXGqRSW/index/index.json (53 passages from 1 book)\n\n> What drives a man to madness?\nEdgar Allan Poe:\n  The disease had sharpened my senses, and above all was the sense of hearing\n  acute [2]. I heard many things in hell, and this acute perception drove my\n  actions [2].\n\nCited passages:\n  [2] Three Tales of Terror, \"The Tell-Tale Heart\"\n      \"... I heard many things in hell.\"\n  (29 s)\n\n> Can anyone escape death?\nEdgar Allan Poe:\n  No, escape from death is a phantom I have never witnessed. Darkness and\n  Decay hold illimitable dominion over all [1]. The life of the ebony clock\n  goes out with that of the last of the gay [1].\n\nCited passages:\n  [1] Three Tales of Terror, \"The Masque of the Red Death\"\n      \"... And the life of the ebony clock went out with that of the last of\n       the gay.\"\n  (14 s)\n\n> What do you think of smartphones?\nThe spirits are silent on this.\n  why: no passage scored 2 or more (the best scored 0.00), so the model was not called.\n  (0 s)\n```\n\nModel: `gemma4:e2b` via Ollama 0.40.12, on a GitHub Actions runner with 2 CPU cores and no GPU. The whole demo took 44 seconds. The output above is copied unedited from that run.\n\nThe third question is my favorite moment. Poe has nothing to say about smartphones, so the model is never even called. Just silence.\n\nHold a séance with the dead authors on your own bookshelf, on your own computer, with the Wi-Fi off.\n\nYou summon an author from your EPUB library (\"Edgar Allan Poe\"), ask a question, and the ghost answers in the first\nperson. The catch: it may speak **only through passages from its own books**, and it has to cite them. If the books\nhold nothing on the subject, it does not improvise. It says:\n\n```\nThe spirits are silent on this\n```\n\n**For whom:** readers with a library of EPUBs (public-domain classics, family letters, out-of-print books) who want\nto talk with what an author actually wrote, privately, without uploading their books anywhere.\n\n`seance ingest` opens each EPUB with `zipfile` (`META-INF/container.xml` -> OPF -> manifest and spine), reads\ntitle and author from `dc:title` / `dc:creator`, chapter…\nEverything runs on your computer, in plain Python (standard library only, nothing to `pip install`), with an open model served by [Ollama](https://ollama.com).\n\n`~/.seance`.` seance summon` ranks that author's passages against your question with BM25, a classic search formula, written from scratch in about fifty lines.`[1]`, `[2]`, `[3]`, with an instruction: answer in the first person, use only these passages, cite them as `[n]`.\nThe demo uses `gemma4:e2b`, the smallest Gemma 4, so it runs without a GPU: the run above took 44 seconds on 2 CPU cores. A bigger model answers better if your computer can run it: one flag, `--model gemma4:12b`.\n\nThere are 47 tests. They run offline, against a fake Ollama server started in a thread.\n\nIt has honest limits, and the README lists them. The biggest one: BM25 matches words, not meanings. \"Can anyone escape death?\" finds \"The Masque of the Red Death\". \"What is mortality?\" finds nothing, even though Poe writes about death on every page. So silence sometimes means \"no matching words\", not \"Poe never thought about it\". I chose a ghost that is too quiet over a ghost that lies.\n\nBecause the books never leave the computer.\n\nA séance is private. Your library might hold your grandmother's letters, or a book you love and can't find in print anymore. With an open model running locally, none of it goes to a server. The only network request the program makes is to Ollama on `localhost`.\n\nIt also works with the Wi-Fi off. And no company can shut down the séance next year, change the price, or retire the model. The weights are on your disk.\n\nFinally, it costs nothing to run. That matters for a toy like this: nobody pays a monthly fee to chat with Poe.\n\nOn the Día de los Muertos, families set up an ofrenda with things that really belonged to the dead: their photos, their favorite food, their objects. Not imitations.\n\nFor a writer, the thing that really belonged to them is their words. That is the idea behind the citation check. The ghost can only bring to the table what the author actually wrote. When it has nothing, it says so, and the silence is part of the respect.\n\n*A note on how this was made: the repository was created on October 24 with only a license and the technical ground rules, no code. All the code was written during the challenge week by AI agents, with a person reviewing the work.*\n\n*This article was written with AI assistance and approved by a person before publishing.*", "url": "https://wpnews.pro/news/i-held-a-seance-with-edgar-allan-poe-he-may-only-speak-through-his-own-books", "canonical_source": "https://dev.to/antivex/i-held-a-seance-with-edgar-allan-poe-he-may-only-speak-through-his-own-books-2713", "published_at": "2026-10-29 09:10:48+00:00", "updated_at": "2026-10-29 09:16:59.595828+00:00", "lang": "en", "topics": ["ai-tools", "large-language-models", "ai-agents", "developer-tools"], "entities": ["Bookshelf Séance", "Edgar Allan Poe", "Ollama", "Gemma 4", "GitHub Actions", "Hacktoberfest"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/i-held-a-seance-with-edgar-allan-poe-he-may-only-speak-through-his-own-books", "markdown": "https://wpnews.pro/news/i-held-a-seance-with-edgar-allan-poe-he-may-only-speak-through-his-own-books.md", "text": "https://wpnews.pro/news/i-held-a-seance-with-edgar-allan-poe-he-may-only-speak-through-his-own-books.txt", "jsonld": "https://wpnews.pro/news/i-held-a-seance-with-edgar-allan-poe-he-may-only-speak-through-his-own-books.jsonld"}}