A Simple and Universal Swarm Intelligence Engine, Predicting Anything. 简洁通用的群体智能引擎,预测万物
Go to file
Flowershangfromthebranches 1a9ec7c717 fix: unify profile ID normalization with fallback chain
When profiles.json lacks agent_id/user_id fields, the backend and Web
Console would fall back to empty strings or "unknown", breaking agent
routing and dropdown rendering.

Add _resolve_agent_id() (Python) and _resolveId() (JS) implementing a
unified fallback chain: agent_id → user_id → name slug → positional
agent_N. Applied consistently across list_agents, get_agent,
send_questionnaire, _simulation_round_structured_input, _profiles_summary,
and Web Console embedded data normalization.

Web Console now refreshes the dropdown from the API when online
(authoritative backend IDs), with normalized embedded profiles as
offline fallback.

Add 12 new tests covering: resolve logic, list_agents/get_agent/ask_agent
fallback IDs, and Web Console HTML generation (no "unknown" values,
embedded profiles carry agent_id).

98 passed, 0 failed. Provider boundary check passed.

🤖 Generated with [Qoder][https://qoder.com]
2026-06-10 09:16:22 +08:00
.github/workflows feat(docker): add Docker support with Dockerfile, docker-compose.yml, and .dockerignore; update README for Docker deployment instructions 2026-01-22 14:35:41 +08:00
backend fix: unify profile ID normalization with fallback chain 2026-06-10 09:16:22 +08:00
docs/agent-usage Add agent web interaction console 2026-06-10 08:34:28 +08:00
frontend Refactor MiroFish into staged agent engine 2026-06-07 13:49:55 +08:00
locales fix(i18n): further shorten English metrics and improve workflow layout 2026-04-01 19:07:19 +08:00
scripts Refactor MiroFish into staged agent engine 2026-06-07 13:49:55 +08:00
static/image feat(README): add demo video sections for Wuhan University Public Opinion and Dream of the Red Chamber simulations; include new image asset 2026-01-20 11:17:11 +08:00
.dockerignore feat(docker): add Docker support with Dockerfile, docker-compose.yml, and .dockerignore; update README for Docker deployment instructions 2026-01-22 14:35:41 +08:00
.env.example Refactor MiroFish into staged agent engine 2026-06-07 13:49:55 +08:00
.gitignore fix(report_agent): refine tool call handling and response validation; enforce strict separation between tool calls and final answers 2026-02-24 17:47:44 +08:00
AGENT_KIT.md Add agent web interaction console 2026-06-10 08:34:28 +08:00
Dockerfile feat(docker): add Docker support with Dockerfile, docker-compose.yml, and .dockerignore; update README for Docker deployment instructions 2026-01-22 14:35:41 +08:00
IMPLEMENTATION_SUMMARY.md fix: unify profile ID normalization with fallback chain 2026-06-10 09:16:22 +08:00
LICENSE Add GNU AGPL v3 License 2025-12-19 15:24:16 +08:00
README-ZH.md docs(readme): fix typo in Shanda logo alt text 2026-05-23 16:30:55 +08:00
README.md Refactor MiroFish into staged agent engine 2026-06-07 13:49:55 +08:00
docker-compose.agent.yml Refactor MiroFish into staged agent engine 2026-06-07 13:49:55 +08:00
docker-compose.yml feat(docker): add Docker support with Dockerfile, docker-compose.yml, and .dockerignore; update README for Docker deployment instructions 2026-01-22 14:35:41 +08:00
package-lock.json Change project license from Apache-2.0 to AGPL-3.0 in package.json, package-lock.json, and backend/pyproject.toml. 2025-12-22 16:41:45 +08:00
package.json Fix: Change backend dev color to green 2025-12-30 10:04:27 +00:00

README.md

MiroFish Logo

666ghj%2FMiroFish | Trendshift

简洁通用的群体智能引擎,预测万物
A Simple and Universal Swarm Intelligence Engine, Predicting Anything

666ghj%2FMiroFish | Shanda

GitHub Stars GitHub Watchers GitHub Forks Docker Ask DeepWiki

Discord X Instagram

English | 中文文档

Overview

MiroFish is a next-generation AI prediction engine powered by multi-agent technology. By extracting seed information from the real world (such as breaking news, policy drafts, or financial signals), it automatically constructs a high-fidelity parallel digital world. Within this space, thousands of intelligent agents with independent personalities, long-term memory, and behavioral logic freely interact and undergo social evolution. You can inject variables dynamically from a "God's-eye view" to precisely deduce future trajectories — rehearse the future in a digital sandbox, and win decisions after countless simulations.

You only need to: Upload seed materials (data analysis reports or interesting novel stories) and describe your prediction requirements in natural language
MiroFish will return: A detailed prediction report and a deeply interactive high-fidelity digital world

Our Vision

MiroFish is dedicated to creating a swarm intelligence mirror that maps reality. By capturing the collective emergence triggered by individual interactions, we break through the limitations of traditional prediction:

  • At the Macro Level: We are a rehearsal laboratory for decision-makers, allowing policies and public relations to be tested at zero risk
  • At the Micro Level: We are a creative sandbox for individual users — whether deducing novel endings or exploring imaginative scenarios, everything can be fun, playful, and accessible

From serious predictions to playful simulations, we let every "what if" see its outcome, making it possible to predict anything.

🌐 Live Demo

Welcome to visit our online demo environment and experience a prediction simulation on trending public opinion events we've prepared for you: mirofish-live-demo

📸 Screenshots

Screenshot 1 Screenshot 2
Screenshot 3 Screenshot 4
Screenshot 5 Screenshot 6

🎬 Demo Videos

1. Wuhan University Public Opinion Simulation + MiroFish Project Introduction

MiroFish Demo Video

Click the image to watch the complete demo video for prediction using BettaFish-generated "Wuhan University Public Opinion Report"

2. Dream of the Red Chamber Lost Ending Simulation

MiroFish Demo Video

Click the image to watch MiroFish's deep prediction of the lost ending based on hundreds of thousands of words from the first 80 chapters of "Dream of the Red Chamber"

Financial Prediction, Political News Prediction and more examples coming soon...

🔄 Workflow

  1. Graph Building: Seed extraction & Individual/collective memory injection & GraphRAG construction
  2. Environment Setup: Entity relationship extraction & Persona generation & Agent configuration injection
  3. Simulation: Dual-platform parallel simulation & Auto-parse prediction requirements & Dynamic temporal memory updates
  4. Report Generation: ReportAgent with rich toolset for deep interaction with post-simulation environment
  5. Deep Interaction: Chat with any agent in the simulated world & Interact with ReportAgent

🚀 Quick Start

Agent Engine Mode

MiroFish now supports CLI/MCP-driven agent mode. In this mode desktop agents process model tasks through request/response files, so LLM_API_KEY, OPENAI_API_KEY, and ZEP_API_KEY are not required.

See AGENT_KIT.md, docs/agent-usage/codex.md, and docs/agent-usage/mcp.md.

Install agent engine dependencies from the backend when using CLI/MCP mode:

cd backend
uv sync --extra agent --group dev

Legacy OpenAI-compatible and Zep Cloud SDKs are optional:

cd backend
uv sync --extra legacy

Prerequisites

Tool Version Description Check Installation
Node.js 18+ Frontend runtime, includes npm node -v
Python ≥3.11, ≤3.12 Backend runtime python --version
uv Latest Python package manager uv --version

1. Configure Environment Variables

# Copy the example configuration file
cp .env.example .env

# Edit the .env file. Agent mode does not require model or Zep API keys.

Default Agent Environment Variables:

MIROFISH_MODE=agent
MIROFISH_LLM_PROVIDER=agent_queue
MIROFISH_GRAPH_PROVIDER=graphiti
MIROFISH_RUNS_DIR=./runs

NEO4J_URI=bolt://localhost:7687
NEO4J_USER=neo4j
NEO4J_PASSWORD=password
NEO4J_DATABASE=neo4j

MIROFISH_GRAPH_SEARCH_MODE=fulltext
MIROFISH_EMBEDDING_PROVIDER=none

Legacy Compatibility Variables:

These are required only when explicitly using MIROFISH_LLM_PROVIDER=openai_compatible or MIROFISH_GRAPH_PROVIDER=zep. Install the optional legacy SDKs with uv sync --extra legacy.

# LLM API Configuration (supports any LLM API with OpenAI SDK format)
# Recommended: Alibaba Qwen-plus model via Bailian Platform: https://bailian.console.aliyun.com/
# High consumption, try simulations with fewer than 40 rounds first
LLM_API_KEY=your_api_key
LLM_BASE_URL=https://dashscope.aliyuncs.com/compatible-mode/v1
LLM_MODEL_NAME=qwen-plus

# Zep Cloud Configuration
# Free monthly quota is sufficient for simple usage: https://app.getzep.com/
ZEP_API_KEY=your_zep_api_key

2. Install Dependencies

# One-click installation of all dependencies (root + frontend + backend)
npm run setup:all

Or install step by step:

# Install Node dependencies (root + frontend)
npm run setup

# Install Python dependencies (backend, auto-creates virtual environment)
npm run setup:backend

3. Start Services

# Start both frontend and backend (run from project root)
npm run dev

Service URLs:

  • Frontend: http://localhost:3000
  • Backend API: http://localhost:5001

Start Individually:

npm run backend   # Start backend only
npm run frontend  # Start frontend only

Option 2: Docker Deployment

# 1. Configure environment variables (same as source deployment)
cp .env.example .env

# 2. Pull image and start
docker compose up -d

Reads .env from root directory by default, maps ports 3000 (frontend) / 5001 (backend)

Mirror address for faster pulling is provided as comments in docker-compose.yml, replace if needed.

📬 Join the Conversation

QQ Group

 

The MiroFish team is recruiting full-time/internship positions. If you're interested in multi-agent simulation and LLM applications, feel free to send your resume to: mirofish@shanda.com

📄 Acknowledgments

MiroFish has received strategic support and incubation from Shanda Group!

MiroFish's simulation engine is powered by OASIS (Open Agent Social Interaction Simulations), We sincerely thank the CAMEL-AI team for their open-source contributions!

📈 Project Statistics

Star History Chart