DEV Community

Cover image for MiroFish: the Open Source AI Engine Predicting Everything
Wanda
Wanda

Posted on • Originally published at apidog.com

MiroFish: the Open Source AI Engine Predicting Everything

Artificial intelligence is evolving rapidly, but most AI tools still follow a familiar pattern: you provide a model with a prompt, and it generates a response.

Try Apidog today

Recently, a new approach has emerged: multi-agent simulations. In these systems, many autonomous AI agents interact within a shared digital environment. Instead of a single model producing an answer, these simulations model groups of agents exchanging information, forming opinions, and influencing each other.

A prominent open-source project in this space is MiroFish, a swarm intelligence engine designed to simulate real-world scenarios using thousands of AI agents. Its core goal is to provide a digital sandbox for exploring complex events—such as financial markets, public opinion shifts, and policy reactions—before they occur in reality.

💡 Building or interacting with AI agents and MCP servers? Apidog provides a powerful, built-in MCP Client for debugging and testing MCP Servers. Connect via STDIO or HTTP, test executable Tools, Prompts, and Resources visually, and handle OAuth 2.0 and rich Markdown/image responses—streamlining MCP integration testing.

Unlike traditional AI that outputs an answer directly, MiroFish builds a digital society of AI agents. Each agent has its own memory, personality traits, and decision logic. When you introduce an event—such as breaking news or a market signal—the agents interact and influence each other’s behavior.

Over time, these interactions form emergent patterns, revealing possible outcomes or sentiment shifts. This makes MiroFish a powerful environment for experimentation and forecasting.

MiroFish simulation screenshot
Source: X

What Is MiroFish?

MiroFish system overview

MiroFish is a swarm intelligence simulation engine based on multi-agent AI. Instead of one model, it generates a population of autonomous agents within a simulated environment. Each agent represents a participant in this virtual society, with:

  • Personality traits
  • Behavioral rules
  • Long-term memory
  • Social relationships
  • Decision-making processes

As agents interact—exchanging information and responding to events—emergent behavior occurs, i.e., system-level patterns arise from individual actions.

By simulating these interactions, MiroFish models how real-world events may unfold, acting as a sandbox for 'what-if' scenarios.

The Vision: A Mirror of Collective Intelligence

Collective intelligence diagram

MiroFish aims to be a collective intelligence mirror of the real world. Traditional predictive systems rely on historical data and statistical models, but often fail when human behavior is unpredictable or socially driven.

Key examples:

  • Financial markets swayed by investor sentiment
  • Unpredictable social media trends
  • Rapidly shifting public reactions to policy

MiroFish takes a different approach: it recreates a digital environment where simulated agents interact and influence one another. Observing these interactions can yield insights into potential real-world outcomes.

From Seed Data to a Digital World

Seed data to simulation

To run a simulation, start with seed material—the information defining your scenario. This can include:

  • News articles
  • Financial or policy reports
  • Research papers
  • Social media discussions
  • Fictional stories

Upload your material and describe your prediction goal in natural language. Example use cases:

  • Simulate market response to a new policy
  • Model public reaction to a statement
  • Predict how a narrative might evolve

MiroFish then builds a parallel digital world where agents interact according to your scenario.

MiroFish Workflow: Simulation Pipeline

MiroFish workflow

MiroFish transforms seed data into a dynamic simulation via several stages:

1. Knowledge Graph Construction

Knowledge graph

  • Extracts entities and relationships from data sources (news, financials, policies, discussions).
  • Builds a GraphRAG-based knowledge graph to structure information for the simulation.
  • Injects both individual and group memory structures so agents retain historical context.

2. Environment Generation

Environment generation

  • Extracts entities/relationships
  • Generates agent personas
  • Builds social networks
  • Configures simulation parameters

Agents are assigned identities, backgrounds, and behavioral rules to reflect realistic social dynamics.

3. Parallel Simulation Execution

  • Agents operate simultaneously, responding to events and interacting.
  • The platform supports thousands of agents across parallel systems.
  • Agents interpret prediction requests, simulate social interactions, update memory, and dynamically evolve the environment.

4. Report Generation

After multiple simulation cycles, a specialized agent—ReportAgent—analyzes the results, producing structured reports that summarize:

  • Key outcomes
  • Trends
  • Behavioral insights
  • Risks

This helps users interpret simulation results and anticipate real-world implications.

5. Deep Interaction

Deep interaction

Users can interact directly with the simulated world:

  • Communicate with individual agents
  • Query their decisions and motivations
  • Explore group dynamics
  • Engage with ReportAgent for deeper analysis

This interactive capability sets MiroFish apart from static forecasting tools.

Quick Start: Running MiroFish Locally

You can deploy MiroFish locally via source or Docker. Here’s a practical setup guide.

System Requirements

Ensure the following tools are installed:

Tool Version Purpose
Node.js 18+ Frontend runtime
Python 3.11–3.12 Backend runtime
uv Latest Python package manager

Check installations:

node -v
python --version
uv --version
Enter fullscreen mode Exit fullscreen mode

Step 1: Configure Environment Variables

Copy the sample config:

cp .env.example .env
Enter fullscreen mode Exit fullscreen mode

Edit .env and add required API keys.

LLM API Configuration

MiroFish supports any OpenAI SDK-compatible API.

Example:

LLM_API_KEY=your_api_key
LLM_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1
LLM_MODEL_NAME=qwen-plus
Enter fullscreen mode Exit fullscreen mode

Recommended: Use the Qwen model from Alibaba’s Bailian platform.

For large simulations, start with fewer than 40 rounds to manage compute resources.


Memory System Configuration

MiroFish uses Zep Cloud for agent long-term memory.

Example:

ZEP_API_KEY=your_zep_api_key
Enter fullscreen mode Exit fullscreen mode

Zep Cloud’s free tier suffices for small experiments.


Step 2: Install Dependencies

Install all dependencies at once:

npm run setup:all
Enter fullscreen mode Exit fullscreen mode

Or install separately:

Frontend:

npm run setup
Enter fullscreen mode Exit fullscreen mode

Backend (creates Python virtualenv):

npm run setup:backend
Enter fullscreen mode Exit fullscreen mode

Step 3: Launch the Platform

Start both services:

npm run dev
Enter fullscreen mode Exit fullscreen mode

Default URLs:

To run only backend:

npm run backend
Enter fullscreen mode Exit fullscreen mode

To run only frontend:

npm run frontend
Enter fullscreen mode Exit fullscreen mode

Docker Deployment

For containerized environments:

  1. Configure environment variables as above:

    cp .env.example .env
    
  2. Start containers:

    docker compose up -d
    

Default ports:

  • 3000: Frontend UI
  • 5001: Backend API

Docker config includes optional mirror sources for faster image downloads.

Final Thoughts

MiroFish future vision

Swarm intelligence platforms like MiroFish represent a step toward simulating complex social environments. Imagine testing policies before launch, anticipating market reactions, or studying information spread across networks—all inside a controllable simulation.

No simulation can fully capture real human complexity, but MiroFish demonstrates how AI can move beyond Q&A and begin modeling societal dynamics. As multi-agent simulation advances, tools like MiroFish may become essential for predictive analysis and digital experimentation.

Top comments (0)