DEV Community

Tharindra Dasuni
Tharindra Dasuni

Posted on

GhostEcho 👻 – Bringing Ghost Stories to Life with Open-Source AI

Hacktoberfest Open-Source AI Challenge: Ghost in the Machine Submission 👻🌼

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine.

What I Built

GhostEcho is a concept for an offline AI-powered ghost story generator that transforms simple ideas, mysterious locations, and forgotten memories into immersive supernatural stories.

Inspired by the Ghost in the Machine theme, I wanted to explore a fascinating question:

What happens when artificial intelligence becomes a storyteller for the mysteries, memories, and legends of the past?

The goal is to create a storytelling experience powered by locally running, open-weight AI models rather than relying on expensive cloud-based APIs.

Key Features

  • 👻 AI Ghost Story Generation: Generate original supernatural stories from user-provided prompts.
  • 🧠 Context-Aware Storytelling: Adapt narratives based on locations, characters, themes, and user choices.
  • 💻 Local AI Inference: Run an open-weight language model using Ollama.
  • 🔐 Privacy-Focused Design: Keep story prompts and generated content on the user's computer.
  • 🎃 Halloween-Inspired Experience: Explore haunted places, mysterious events, and forgotten legends.
  • 🌐 Simple Web Interface: Interact with the storytelling engine through a lightweight Flask application.

GhostEcho explores how open-source AI can turn ordinary ideas into creative, atmospheric storytelling experiences.

Example Interaction

User Prompt:

"Tell me a mysterious ghost story about an abandoned railway station in Sri Lanka."

Illustrative AI Response:

"Every night at exactly 11:59 PM, the abandoned railway station echoed with the sound of an approaching train. But the tracks had been silent for over forty years. One evening, a young traveler discovered a faded ticket lying on the platform. Printed on it was tomorrow's date — and his own name."

This illustrates the type of interactive storytelling experience GhostEcho aims to provide.

Code

The project is designed around widely accessible open-source tools, allowing developers to explore, customize, and extend the storytelling experience.

Proposed Project Structure

  • app.py – Flask application and API endpoints
  • templates/index.html – Main storytelling interface
  • static/css/style.css – Halloween-inspired styling
  • static/js/script.js – Frontend interactions
  • requirements.txt – Python dependencies
  • README.md – Setup and documentation

How I Built It

The proposed architecture uses open-source technologies to make AI storytelling accessible without requiring a commercial AI API.

Technology Stack

Technology Purpose
Python Core application development
Flask Backend web framework
Ollama Local AI model inference
Google Gemma Open-weight language model
HTML, CSS, JavaScript Interactive user interface
Git and GitHub Version control and collaboration

Architecture

The user enters a creative prompt through the web interface.

The Flask backend receives the request and prepares a storytelling instruction.

Ollama processes the request using a locally running Gemma model.

The generated story is returned to the web interface, where the user can read the result and continue experimenting with new ideas.

Development Approach

The design focuses on three principles:

1. Accessibility

Developers should be able to experiment with generative AI using open tools without needing a paid API subscription.

2. Privacy

When running entirely locally, personal stories, fictional ideas, and prompts do not need to be transmitted to an external inference service.

3. Customization

By using an open-weight model, developers can experiment with different prompts, model sizes, inference settings, and storytelling styles.

Why Does Open Innovation Matter?

Open innovation is at the heart of GhostEcho.

Many AI applications depend on proprietary cloud services, which may introduce usage costs, internet requirements, and limitations on customization.

Open-weight models and open-source inference tools provide a different approach.

With Ollama and Gemma, it becomes possible to build an AI-powered experience that can run directly on a personal computer.

This creates several important opportunities:

  • Greater developer control: Developers can customize the inference process and experiment with different models.
  • Better data privacy: Local inference allows user-generated content to remain on a machine they control.
  • Reduced dependency: The application's core AI functionality does not have to depend on a third-party API.
  • Accessible experimentation: Students and independent developers can explore practical AI applications using freely available tools.
  • Community collaboration: Open development enables others to inspect, improve, and extend the project.

For me, open innovation is about making advanced technology accessible to developers regardless of their financial resources or geographical location.

As a software engineering student and developer from Sri Lanka, I believe that open technologies can help more people participate in building meaningful AI applications.

The Spirit of It

"Every ghost has a story. Every forgotten place has a memory."

GhostEcho is inspired by the idea that technology can transform the stories we imagine into interactive experiences.

The most interesting part of the concept is not simply generating frightening stories.

It is exploring how AI can create an atmosphere of mystery from something as simple as an abandoned building, an old photograph, or a forgotten legend.

The Halloween theme offered an opportunity to combine creativity, storytelling, and open-source artificial intelligence.

GhostEcho represents that intersection between imagination and technology.

Sometimes, the most fascinating ghost is not hiding in an abandoned house.

It is waiting inside the machine. 👻

Prize Categories

Best Use of Gemma – Applicable if the completed project genuinely uses Google's Gemma open-weight model as its AI storytelling engine.

Final Thoughts

GhostEcho demonstrates a direction for creating imaginative AI experiences using open technologies.

The project is intended to show that generative AI development does not always require proprietary cloud infrastructure.

With open-weight models, local inference, and community-driven frameworks, developers can build creative applications while maintaining control over their technology.

Thank you to the DEV Community and Hacktoberfest organizers for inspiring developers to explore the possibilities of open-source AI.

Happy Hacktoberfest 2026! 🎃👻

devchallenge #hf26challenge #opensource #ai

Top comments (0)