Inspiration

Chronos was born from the timeless human fascination with "What if?"—the butterfly effect. I’ve always wondered how history would have unfolded if a single event had gone differently: What if the Library of Alexandria hadn't burned? What if the Roman Empire never fell? I wanted to move beyond static fiction and create a dynamic, living simulation where users could pull the threads of history themselves and watch the tapestry unravel in real-time. I was inspired by strategy games like Civilization and the narrative depth of historical fiction, but I wanted an experience that was generated on the fly, responsive to any wild idea a user could throw at it.

What it does

Chronos is an interactive alternative-history simulator that lets users diverge from real history at any point in time.

  • The Divergence Point: You enter a specific change (e.g., "The Aztecs discover gunpowder in 1400").
  • The Cabinet: An AI-powered "Cabinet" of advisors (Military, Economic, Diplomatic, Social) debates the consequences of your change. You can see their reasoning in real-time.
  • The Simulation: The timeline advances, year by year or decade by decade. The world map shifts, technologies evolve, and society adapts.
  • Multimodal Experience: Every new era is brought to life with period-accurate AI-generated imagery and dynamic audio narration, turning a text simulation into a multimedia documentary of a world that never was.
  • The Librarian: A dedicated "Fact-Checker" agent compares your new timeline against real history, highlighting exactly where and how your world has diverged from our own.
  • Autonomous Missions: A sophisticated agent that can play through a full timeline simulation automatically towards a specific goal (e.g., "Achieve World Peace by 2050"), making strategic decisions without user intervention.
  • Movie Maker Mode: Compiles the simulation's generated assets into a seamless video documentary prompt.

How I built it

Chronos is a modern full-stack application built with Next.js 16 and React 19 on the frontend, ensuring a fast, responsive UI with complex state management for the timeline. The backend is powered by FastAPI, orchestrating the complex multi-agent logic.

I integrated Gemini 3 models as the core intelligence engine of the entire platform, leveraging its advanced reasoning and multimodal capabilities to create a deep historical simulation. Specifically, I utilize Gemini 3 Flash Preview for the simulation logic, harnessing its Thinking Process to power the unique "Cabinet Debate" feature. This allows the model to "think" (stream its internal reasoning) through the perspectives of Military, Economic, and Diplomatic advisors before rendering a final timeline update, giving users visibility into the AI's reasoning chain rather than just a final output.

For historical accuracy, I integrated the Google Search Tool within the "Librarian Agent", enabling real-time grounding to distinguish between actual historical facts and the simulated divergences. Visually, Gemini 3 Pro Image Preview generates period-accurate artwork for each timeline shift, while Gemini 2.5 Flash TTS provides dynamic voice narration, creating a fully immersive, multimodal experience where text, image, and sound are synchronized to the user's unique history.

Challenges I ran into

  • Managing Chaos: Historical simulation is complex. Early versions of the model would spiral into absurdity too quickly. I had to implement a "Chaos Level" and "Stability" metric to keep the simulation grounded in plausible cause-and-effect.
  • Latency vs. Experience: Generating rich text, an image, and audio for every turn takes time. I solved this by streaming the text and "thoughts" immediately while loading the heavy assets (audio/images) asynchronously in the background, keeping the user engaged with the "Cabinet Debate" while the rest of the world loaded.

Accomplishments that I'm proud of

  • The "Cabinet" Visualization: Watching the AI debate itself—seeing the "Military Advisor" argue with the "Diplomat"—is incredibly engaging and makes the AI feel like a team of distinct characters rather than a single black box.
  • True Multimodality: I didn't just add images as an afterthought. The audio narration and visual style adapt to the era (e.g., sepia tones for the 1800s, digital glitz for the 2000s), making the simulation feel cohesive.
  • The "Librarian" Grounding: Successfully using the Google Search tool to fact-check the generated history against real history adds a layer of educational value to the entertainment.
  • Complex State Management: Successfully tracking world state (population mood, technology levels, borders) across dozens of simulation turns without the AI losing the plot.

What I learned

  • The Power of "Thinking": Allowing the model to output its chain of thought (the "Cabinet Debate") before the final answer significantly improved the quality and logic of the simulation. It wasn't just a UI trick; it made the simulation smarter.
  • Structured Prompts are Key: I learned that defining distinct personas (Economist, General, etc.) with specific system instructions yields far better results than a single generic prompt.
  • History is Fragile: Requires a delicate balance of constants and variables. I gained a new appreciation for how interconnected our own history is.

What's next for Chronos

  • User Accounts & Sharing: I want users to be able to save their best timelines and share them as "What If?" stories with the community.
  • Branching Timelines: Allowing users to go back to a previous point in their simulation and try a different choice to see how it branches differently.
  • VR Integration: Imagine standing in the middle of a 1950s timeline where Rome never fell. I am exploring video generation (video_prompt_agent) to take the immersion to the next level.

Built With

  • fastapi
  • gemini-2.5-flash-preview-tts
  • gemini-3-flash-preview
  • gemini-3-pro-image-preview
  • google-genai-sdk
  • nextjs
  • python
  • tailwindcss
Share this project:

Updates