Multi-persona AI Agent System powered by MCP (Model Context Protocol)
A semantic router that dynamically loads specialized agents, skills, and cognitive implants based on user queries. Built for Cursor IDE with Human-AI symbiosis in mind.
git clone https://github.com/WonderMr/Agents
cd Agents
# Run initialization script
./scripts/init_repo.shEdit .env file created by the script:
OPENAI_API_KEY=sk-... # Required: for embeddings
LANGFUSE_PUBLIC_KEY=pk-lf-... # Optional: observability
LANGFUSE_SECRET_KEY=sk-lf-... # Optional: observabilityTo load MCP server and agent rules.
/route "How do I fix this bug?"
The initialization script performs these steps:
| Step | Description |
|---|---|
| 1. Python Check | Finds suitable Python (3.10-3.12), prefers 3.11 for ML compatibility |
| 2. Environment Config | Creates .env from env.example, merges missing keys if exists |
| 3. Virtual Environment | Creates .venv/ with selected Python version |
| 4. Dependencies | Installs all packages from requirements.txt |
| 5. MCP Integration | Merges mcp.json into ~/.cursor/mcp.json (global Cursor config) |
| 6. ChromaDB | Prepares vector database path (initialized on first run) |
| 7. Validation | Counts agents, skills, implants, commands |
./scripts/init_repo.sh --skip-env # Skip .env creation
./scripts/init_repo.sh --skip-chroma # Skip ChromaDB check
./scripts/init_repo.sh --help # Show helpRun language detection tests:
./scripts/run_tests.sh # Run all language detection tests
./scripts/run_tests.sh -k russian # Run only Russian detection test
./scripts/run_tests.sh --verbose # Verbose outputThe test script automatically detects and uses:
.venv/orvenv/if present- pyenv Python (prefers 3.12.4)
- Verifies
langdetectandpytestare installed
pydantic>=2.0 # Data validation
openai>=1.0 # OpenAI API client
chromadb>=0.4 # Vector database for RAG
langfuse>=2.0 # Observability/tracing
sentence-transformers # Embeddings
python-dotenv # Environment management
mcp>=0.1.0 # Model Context Protocol
pdf2image, Pillow # Document OCR support
anthropic>=0.18.0 # Claude API (optional)
After initializing the Agents repo, you can use the agent framework in any other project.
# From your target project
cp -r /path/to/Agents/.cursor /path/to/your-project/This copies:
- β
All agent personas (
agents/) - β
Slash commands (
commands/) - β
Cognitive implants (
implants/) - β
Domain skills (
skills/) - β
Routing rules (
rules/)
In Cursor IDE (from Agents repo):
/install_repo /path/to/target-repo
-
MCP Server Location: The MCP server (
Agents-Core) runs from the original Agents repo. The.cursor/folder only contains agent definitions. -
Global MCP Config: The
~/.cursor/mcp.jsonfile points to the Agents repo. This is configured once duringinit_repo.sh. -
Restart Required: After copying
.cursor/, restart Cursor to load new rules. -
Project-Specific Rules: You can add project-specific rules in the target repo's
.cursor/rules/without affecting the Agents repo.
~/.cursor/
βββ mcp.json # Points to Agents repo MCP server
/path/to/Agents/ # Source repository
βββ src/server.py # MCP server (runs here)
βββ .venv/ # Python environment
βββ .cursor/ # Agent definitions (source)
/path/to/your-project/ # Target repository
βββ .cursor/ # Copied agent definitions
βββ agents/
βββ commands/
βββ skills/
βββ rules/
| Command | Agent | Purpose |
|---|---|---|
/route |
Router | Check available agents |
/universal |
Universal Agent | General tasks |
/dev |
Software Engineer | Development tasks |
/debug_ai |
AI Debugger | Debug AI systems |
/security_audit |
Security Expert | Security analysis |
/docs |
Tech Writer | Documentation |
/research |
Deep Researcher | Deep dive research |
/investigate |
Investigative Analyst | Fact-checking, OSINT |
/doctor |
Medical Expert | Clinical analysis |
/bio_protocol |
Bio-Hacker | Health protocols |
/psy_session |
Psychologist | Psychological support |
/draw |
Diagram Architect | Mermaid diagrams |
/purchase |
Purchase Researcher | Product research |
/briefing |
Daily Briefing | News digest |
/3dprint |
3D Print Finder | 3D model search |
/insta_audit |
Instagram Analyst | Social media analysis |
/site_audit |
Website Analyst | Website audit |
/ocr |
Document OCR Expert | Text from images/PDF |
/forensic |
Data Forensic | Leak analysis |
/new_agent |
Agent Builder | Create new agents |
/new_mcp |
MCP Builder | Create MCP servers |
User Query β Semantic Router β Cache Check β Agent Selection β Context Enrichment β Response
- User Query β Semantic Router analyzes intent
- Cache Check β Fast path if query pattern is cached
- Agent Selection β Best-fit agent loaded dynamically
- Context Enrichment β Skills + Implants injected via RAG
- Response β Agent-specific system prompt applied
Agents/
βββ .cursor/
β βββ agents/ # Agent personas (system prompts)
β βββ skills/ # Reusable capabilities (RAG)
β βββ implants/ # Cognitive strategies (RAG)
β βββ commands/ # Slash commands
β βββ rules/ # Cursor rules
βββ src/
β βββ server.py # MCP Server entrypoint
β βββ engine/
β β βββ router.py # Semantic routing logic
β β βββ skills.py # Skill retrieval (ChromaDB)
β β βββ implants.py # Implant retrieval (ChromaDB)
β βββ mcp_servers/ # Additional MCP servers
βββ scripts/
β βββ init_repo.sh # Initialization script
βββ chroma_db/ # Vector database (auto-created)
βββ requirements.txt
| Component | Description |
|---|---|
| Agents | Specialized personas with unique system prompts |
| Skills | Domain-specific knowledge (retrieved via RAG) |
| Implants | Cognitive patterns & reasoning strategies |
| Router | Semantic matching + caching for fast selection |
| ChromaDB | Vector store for skills/implants embeddings |
The framework runs as an MCP server, providing tools to Cursor:
| Tool | Purpose |
|---|---|
get_routing_info |
Check cache / get available agents |
get_agent_context |
Load agent prompt + update cache |
get_context |
Retrieve dynamic skills + implants |
get_relevant_implants |
Query cognitive implants |
get_reasoning_strategy |
Load task-specific reasoning |
log_interaction |
Observability logging to Langfuse |
After init_repo.sh, your ~/.cursor/mcp.json contains:
{
"mcpServers": {
"Agents-Core": {
"command": "/absolute/path/to/Agents/.venv/bin/python",
"args": ["/absolute/path/to/Agents/src/server.py"]
}
}
}Use /new_agent command or manually:
- Create directory:
.cursor/agents/<agent_name>/ - Create
system_prompt.mdc:
---
identity:
name: "my_agent"
display_name: "My Agent"
role: "Expert in X"
tone: "Professional, Clear"
routing:
domain_keywords: ["keyword1", "keyword2"]
trigger_command: "/mycmd"
static_skills:
- "skill-relevant.mdc"
---
# My Agent System Prompt
## Identity
You are an expert in X...
## Protocol
...- Create rule:
.cursor/rules/10-my-agent.mdc - Create command:
.cursor/commands/mycmd.md
Integrates with LangFuse for tracing:
- All tool calls automatically traced
- Routing decisions logged
- Cache hits/misses tracked
Configure in .env or leave blank for local-only operation.
If you prefer not to use the script:
# Create virtual environment
python3.11 -m venv .venv
source .venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Configure environment
cp env.example .env
nano .env # Add your API keys
# Configure MCP manually in ~/.cursor/mcp.json| Directory | README |
|---|---|
.cursor/ |
Overview & Deployment |
.cursor/agents/ |
Agent Personas |
.cursor/commands/ |
Slash Commands |
.cursor/implants/ |
Cognitive Implants |
.cursor/skills/ |
Domain Skills |
MIT