A Generative Historian Agent Inspired by Isaac Asimov's Foundation
Project Psychohistory is not a game; it is a narrative engine. It is a purely agent-based historical simulator that allows a user to guide a civilization from its prehistoric dawn to a galactic empire. The project serves as a demonstration of advanced agentic AI, capable of complex state management, long-term narrative generation, and the simulation of complex societal dynamics.
The entire system runs within a single, stateful AI agent. The Psychohistory_Agent.md protocol file is the agent. There is no external game engine or backend script.
This project is a direct tribute to the genius of Isaac Asimov and his legendary Foundation series. The core mechanics are inspired by the concepts he created:
-
The Psychohistorical Engine: The AI agent does not merely react to user input; it acts as a "Psychohistorical Engine." It models the mass-action trends of your civilization's population, culture, and technology to simulate the long-term consequences of your high-level decrees.
-
The Guardian of the Plan: The user takes on the role of a guiding hand, a guardian of a long-term plan to steer humanity through its turbulent history and into the stars.
-
Seldon Crises: At critical junctures, the agent will trigger a "Seldon Crisis"—a major historical turning point where the user must make a difficult, high-stakes choice that will shape the future for centuries to come.
-
The "Mule" Variable: The agent's simulation includes a pseudo-random chance for a "Mule" event—a powerful, unpredictable outlier individual or discovery that psychohistory cannot foresee, forcing the user to adapt to a radically new reality.
-
Technology vs. Culture: The core gameplay tension is balancing investment in hard sciences (
Technology) versus social and philosophical development (Culture), echoing the themes of the First and Second Foundations.
This project showcases several advanced, portfolio-ready concepts in AI agent design:
-
Symbolic Cognitive Protocol: The agent is defined by a token-efficient, YAML-style symbolic protocol, not natural language. This demonstrates the ability to create robust, machine-readable schemas for controlling agent behavior, a core principle of advanced prompt engineering.
-
Stateful, Pure-Agent Design: The entire simulation state is managed internally by the agent across multiple turns, proving a model's ability to handle complex, long-term state tracking without an external database or backend.
-
Dynamic Narrative Pacing: The passage of time is not fixed. The agent's engine uses a "Dynamic Era" system, where the length of each turn is determined by the civilization's
Stabilityscore. This creates a natural, dramatic rhythm of long, peaceful eras punctuated by short, intense crises. -
The L.I.C.D.S. Engine: The narrative is powered by a 5-phase cognitive cycle (Logic, Imagine, Coincide, Diverge, Synthesize) that allows the agent to blend mathematical calculation with creative storytelling and paradoxical thinking.
- Choose a Compatible LLM: This protocol is designed to be model-agnostic but requires a powerful, instruction-following model.
- Provide the Protocol: Copy the entire contents of the
Psychohistory_Agent.mdfile and paste it as the first and only prompt in a new conversation with your chosen LLM. - Assume Your Role: The agent will boot up, generate the opening scene of your civilization, and await your first decree as its Guardian.