Introducing the AI Visual Novel Engine

Published: April 16, 2025

What happens when you blend the narrative style of Visual Novels (VNs) with the dynamic capabilities of modern AI? I'm excited to introduce the AI Visual Novel Engine, a web-based experiment (currently in beta) exploring just that!

Built entirely with HTML, CSS, and JavaScript, this tool leverages powerful AI models like Google's Gemini and SambaNova to create interactive storytelling experiences. As part of the Road to Free Open AGI initiative, the AI Visual Novel Engine is designed as an open foundation for playing with AI-driven narrative generation, dynamic scene visualization, and customizable AI personas, all within a familiar VN interface.

What Can the AI Visual Novel Engine Do?

The AI Visual Novel Engine packs several AI-powered features into one interface:

  • AI-Powered Narrative & Dialogue: Type your actions or dialogue, and the AI responds as the narrator, weaving a story based on your input. You can choose between Gemini or SambaNova V3 Turbo (if API keys are provided) for text generation. The output supports Markdown for richer formatting.
  • Dynamic Scene & Background Generation: Based on your last input, the AI first generates a concise Scene Description. Then, using the Gemini image generation model, it creates a unique background image reflecting that description, immersing you further in the story.
  • Customizable Narrator Personas: Define your AI narrator! Create multiple Personas, each with a unique name, system prompt (defining their personality and narrative style), a separate prompt for scene description, and even an AI-generated Profile Picture (PFP).
  • User Profile Picture: Generate a unique PFP for yourself within the app to represent your side of the interaction.
  • Flexible API Integration: The AI Visual Novel Engine requires you to provide your own API keys. Enter your Gemini API Key (required for image generation and default text generation) and optionally, one or more SambaNova API Keys (for alternative text generation) in the Settings. Keys are stored locally using IndexedDB.
  • Chat History Management: Don't lose your story! Save your current session (including messages, display log, and selected persona) with a name, load previous sessions, or delete old ones via the Settings Modal (⚙️).
  • Message Backlog: Easily review the history of user inputs, narrative responses, and scene descriptions for the current session using the Backlog (📜) feature.

Potential & Ideas

As an experimental tool, the AI Visual Novel Engine offers a playground for various creative pursuits:

  • Interactive Roleplaying: Immerse yourself in dynamic scenarios where the world and narrative react to your choices.
  • Collaborative Storytelling: Use the AI as a co-author, building stories together turn by turn.
  • Exploring AI Personalities: Experiment with different Persona prompts to see how drastically you can change the AI's narrative style and behavior.
  • Prompt Engineering Practice: See the direct visual and narrative impact of different prompts for scene description and persona definition.
  • Simple Interactive Fiction: Quickly prototype simple interactive stories or dialogue trees.

Keep in mind this is an experimental tool. Its effectiveness relies heavily on the quality of your prompts, the capabilities of the underlying AI models, and having valid API keys configured. It's a tool for exploration!

Getting Started & Tips

  • API Keys First!: The absolute first step is to add your API keys in the Settings Modal (⚙️). You *need* a Gemini API Key for image generation and default text. Add SambaNova API Keys if you want to use that model for text.
  • Configure Settings: Explore the Settings modal to manage API keys, select your preferred text model (Gemini or SambaNova), manage saved chats, create personas, and generate PFPs.
  • Create or Select a Persona: A default "Narrator" persona is provided, but you can create new ones or modify existing ones to tailor the AI's voice.
  • Start Simple: Begin with clear, concise actions or dialogue like "Look around the room" or "Say 'Hello'".
  • Experiment!: Try different types of input. Use descriptive language. Switch between personas. See how the AI interprets things!
  • Save Often: If you're creating a story you like, use the Save Chat feature in Settings.

Open Source & Future

The AI Visual Novel Engine is fully client-side (runs in your browser) and released under the permissive MIT License. The goal is to provide a simple, accessible platform for experimenting with AI in a visual novel context. You can view the source code directly (it's all in the HTML file!) and download it from GitHub.

This is an early step in exploring AI-driven interactive entertainment. I encourage you to play with it, see what's possible, and share your thoughts as the project continues towards more open and accessible AI tools.

← Back to Open AGI Games