跳到正文
DEV Community· Khyati Kshitija·· 2 小時前AI 評分24

Hacktoberfest 開源 AI 挑戰第 4 週:Ghost Journal AI: The Hollow

Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine

AI 導讀

作者以 Python、Streamlit、Ollama 和 Llama 3.1 8B 開發 Ghost Journal AI: The Hollow,這是一款超自然謎案調查遊戲,可生成包含三名嫌疑人、線索和隱藏動機的故事。玩家可調查嫌疑人、查看證據、詢問鬧鬼日記並指認兇手,完成的調查會儲存在本機 SQLite 日誌中。模型下載後,應用程式可在本機生成故事,無須持續連接遠端 AI 服務。

正文

What I Built

🕯️ Ghost Journal AI: The Hollow — Where AI Meets the Supernatural

What if a haunted diary could create its own mysteries, hide secrets in evidence, and answer your questions while trying not to reveal the truth?

I built Ghost Journal AI: The Hollow, an AI-powered supernatural mystery investigation game. Players enter a fictional scenario, and the AI creates a mystery with three suspects, evidence clues, hidden motives, and a chilling story.

Players can investigate the suspects, examine the evidence, question a haunted diary, and finally accuse the culprit to reveal the solution.

The application also saves completed investigations in a local journal, so each case becomes part of the player's history.

I interpreted "Ghost in the Machine" as a story in which an AI feels almost supernatural: a voice inside a machine that knows the secrets of a mystery and guides you through the darkness.

Demo

The application currently runs locally on my laptop using Streamlit and Ollama.

Demo: I am preparing a video demonstration of the application.

The demo will show mystery generation, suspect investigation, evidence review, interaction with the haunted diary, and the final accusation.

Code

GitHub repository: Ghost Journal AI: The Hollow

The project is built with Python and Streamlit, uses Ollama for local AI inference, and stores investigation history in SQLite.

Replace the example GitHub URL above with your actual public repository link before publishing.

How I Built It

I built the application using open-source tools and a locally running open-weight language model.

My technology stack includes:

Python — application logic and investigation flow.

Streamlit — the interactive web interface.

Ollama — running the AI model locally.

Llama 3.1 8B — generating mystery stories and powering the haunted diary chatbot.

SQLite — storing investigation history locally.

Requests — communicating with Ollama's local API.

When a player enters a scenario, the application asks the model to generate a structured mystery containing a title, opening scene, three suspects, evidence clues, a diary entry, a culprit, a solution, a twist, and an epilogue.

The player can then question the haunted diary. After the player submits an accusation, the application reveals the culprit and solution and saves the result in the investigation journal.

I tested the main workflow, including case generation, suspect and evidence display, diary responses, accusations, and journal history.

Why Does Open Innovation Matter?

Open innovation made it possible for me to experiment with an AI-powered storytelling experience without building the entire project around a paid, hosted AI API.

By using Ollama and an open-weight model locally, the core AI experience can run on my own machine. After the model has been downloaded, the application can generate stories without requiring a continuous connection to a remote AI service.

This approach also gives me flexibility. I can experiment with different models, adjust prompts, and improve the mystery-generation process without depending entirely on one provider's hosted API.

It also comes with trade-offs: local models require sufficient hardware resources, and AI-generated mysteries can still contain inconsistencies. Improving the logical connection between evidence and solutions is one of my next development goals.

For me, open innovation means being able to learn, experiment, and build something creative with tools that I can run and adapt myself.

My Agent Session

I developed and tested the application locally.

I do not have a DevRelay session link to share at this time.

The Spirit of It

The idea behind The Hollow is simple: what if the machine isn't just answering you, but telling you a story it doesn't want you to finish?

The haunted diary is the heart of the experience. It responds to questions, hints at hidden truths, and keeps the atmosphere alive while the player searches for the culprit.

I wanted to combine the creativity of AI storytelling with the feeling of investigating an old supernatural mystery, where every clue matters and every character might be hiding something.

The project is also an experiment in making local AI feel more personal, interactive, and a little unsettling.

Sometimes the scariest thing isn't a ghost in an old house. It's a voice inside a machine that knows more than it should. 🕯️

My project explores open-weight AI and local inference through an interactive storytelling application.

Built with curiosity, open-source tools, and a haunted diary that refuses to stay silent.

hacktoberfest #hf26challenge #devchallenge #opensource #AI #Python #Streamlit #Ollama

來源:DEV Community · dev.to