Skip to main content

Story Forecaster.

Story continuation with chapter context.

A Python API for story continuation experiments, with chapter retrieval, cutoff filters and separate branches.

  • Python
  • FastAPI
  • SQLite
  • BM25
  • Gemini API
Story Forecaster: workflow

Workflow

Format
API
Platform
Python
Year
2026

About the project

Story Forecaster retrieves relevant passages from imported chapters and uses Gemini to generate continuations. Experiments run in separate branches, with changes to story state validated before they are saved.

Technologies

Built with Python, FastAPI and SQLite. BM25 retrieves passages, and Gemini generates continuations. Tests use pytest.

What is inside

  • Chapter retrieval

    BM25 finds passages from imported chapters for the generation context.

  • Chapter cutoffs

    Filters retrieved passages by chapter number when testing a continuation from an earlier point in the story.

  • Separate continuations

    Keeps alternative continuations in isolated branches and validates story-state changes before saving them.

Want to discuss a project?

Send me an email with what you have in mind.

Email me
Next projectCodeAi