MeshCtx is a 17-brain-region emulated self-improving agent platform.
1
stars
22
commits
Python
primary language
Sep 7, 2026
updated
Quick Start · Why MeshCtx · Features · API · Contributing
Most AI agents are stateless tools. MeshCtx is a cognitive architecture.
| Feature | Typical Agent | MeshCtx |
|---|---|---|
| Memory | Vector store lookup | Hippocampal replay + emotional weighting + pattern chunking |
| Planning | Single-pass chain | Free energy principle + active inference + thalamic gating |
| Self-improvement | None | Genomic optimizer (genetic algorithm on own parameters) |
| Code modification | Static | Neural plasticity-inspired self-modifying code at runtime |
| Architecture | Flat modules | 17 brain regions simulating cortical-subcortical loops |
MeshCtx treats AI agent design as a neuroscience problem, not just an engineering problem.
| Repo | Visibility | Content |
|---|---|---|
| meshctx (this repo) | 🔓 Public | Security modules (full impl) + core module interface stubs (signatures + docs) |
| meshctx-core | 🔒 Private | 33 core modules full implementation (AgentSwarm · Kernel · SuperBrain · Sandbox · MultiAgent · AutonomousEngine) |
For developers: src/core/*.py contains complete interface definitions. Use from src.core.agent_swarm import AgentIdentity for type-safe integration.
Commercial: pip install meshctx-core (private repo, license required) — zero code changes needed.
# Download installer (recommended)
# https://github.com/LucyAndLuna2023/meshctx/releases/latest
# meshctx-setup.exe — NSIS wizard, 7 languages, one-click install
curl -fsSL https://raw.githubusercontent.com/LucyAndLuna2023/meshctx/main/install.sh | bash
meshctx setup # Configure API keys
meshctx start # Start web service (http://localhost:3001)
macOS 专用脚本:
curl -fsSL .../install-mac.sh | bash。 安装脚本默认英文显示;支持 9 语言: zh/en/ja/ko/fr/de/es/it/ar。中文用户可显式切回:MESHCTX_LANG=zh ./install.sh(macOS 同理MESHCTX_LANG=zh ./install-mac.sh;Windows 同理set MESHCTX_LANG=zh && install.bat)。
git clone https://github.com/LucyAndLuna2023/meshctx.git
cd meshctx && pip install -e .
meshctx chat # CLI mode
meshctx start # Web service (default http://localhost:3001)
meshctx chat # CLI conversation
meshctx setup # Configure API keys and models
meshctx desktop # Windows desktop client
meshctx agent # Multi-step autonomous agent
Genetic algorithm that evolves agent's own parameters: temperature, top_p, prompt style, memory weights.
Traditional AI: Store → Keyword match
MeshCtx: Pattern chunking → Emotional weighting → Hippocampal replay → Associative spread
meshctx start --port 3001 # Manager node
# Register worker on another machine
curl -X POST http://manager:3001/swarm/register \
-d '{"worker_id":"bot1","name":"Coder","capabilities":["code"]}'
# Submit complex task — auto-decompose → dispatch → parallel execute
curl -X POST http://manager:3001/swarm/execute \
-d '{"task":"Research best practices + write code + review","type":"research"}'
WeChat Enterprise · Feishu · Telegram · Slack · Discord · WhatsApp
Per day/week/month tracking: sessions · messages · tokens · latency · error rate
Multi-API key rotation: round_robin · least_used · random · auto-exhaustion detection
| Version | Highlights | Tests |
|---|---|---|
| v2.37 | Credential pool rotation | 825 |
| v2.40 | Human-like memory (6 mechanisms) | 916 |
| v2.41 | Self-healing ops engine | 935 |
| v2.42 | Hooks engine (8 events, Claude Code parity) | 956 |
| v3.115 | DeepSeek TUI competitor (14 modules, 4200 lines) | 130 |
| v3.116 | Open-source agent framework (RAG+RRF, Sandbox, GenomicOptimizer, Observability) | 3404 |
meshctx/
├── src/
│ ├── main.py # FastAPI main app
│ ├── web_ui.py # Web UI templates
│ ├── cli.py # CLI commands
│ ├── i18n.py # 10-language i18n
│ └── core/ # Core modules
│ ├── hybrid_reasoning.py # Free energy reasoning
│ ├── observability.py # Span/TraceLogger
│ ├── rag_orchestrator.py # RAG + RRF fusion
│ ├── terminal_sandbox.py # Security sandbox
│ ├── genomic_optimizer.py # Genetic algorithm engine
│ ├── memory_v5.py # 4-tier memory injection
│ └── ... # 14 modules total
├── tests/ # 3404 tests
├── docs/ # Documentation site
└── install.sh # One-click install
| Endpoint | Method | Description |
|---|---|---|
/api/chat | POST | Conversation (JSON) |
/api/chat/stream | POST | Streaming (SSE) |
| Endpoint | Method | Description |
|---|---|---|
/api/dual/plan | POST | Planner planning |
/api/dual/execute | POST | Executor execution |
/api/dual/stats | GET | Session stats |
| Endpoint | Method | Description |
|---|---|---|
/api/memory/stats | GET | Memory diagnostics |
/api/memory/add | POST | Add memory |
/api/memory/search | POST | Search memories |
| Endpoint | Method | Description |
|---|---|---|
/swarm/register | POST | Register worker |
/swarm/execute | POST | Submit swarm task |
/swarm/status | GET | Swarm status |
| Endpoint | Method | Description |
|---|---|---|
/api/subagent/run | POST | Launch isolated subagent |
/api/subagent/{id}/status | GET | Query status |
| Platform | Install | Status |
|---|---|---|
| Windows | NSIS installer (10 languages) | ✅ |
| Linux | curl|bash script | ✅ |
| macOS | DMG + Homebrew | ✅ |
| WSL | Same as Linux | ✅ |
| Docker | docker-compose | ⚠️ WIP |
We welcome contributions! Here's how:
git checkout -b feature/amazing-thingfeat: add thalamic gating filterpython -m pytest tests/ -xgit clone https://github.com/LucyAndLuna2023/meshctx.git
cd meshctx
pip install -e ".[dev]"
python -m pytest tests/ -x
⭐ Star this repo if you find it useful!
Built with 🧠 by LucyAndLuna2023
22 commits
Python
94.2%
HTML
3.3%
Shell
1.9%
MeshCtx is a 17-brain-region emulated self-improving agent platform.
1
stars
22
commits
Python
primary language
Sep 7, 2026
updated
Quick Start · Why MeshCtx · Features · API · Contributing
Most AI agents are stateless tools. MeshCtx is a cognitive architecture.
| Feature | Typical Agent | MeshCtx |
|---|---|---|
| Memory | Vector store lookup | Hippocampal replay + emotional weighting + pattern chunking |
| Planning | Single-pass chain | Free energy principle + active inference + thalamic gating |
| Self-improvement | None | Genomic optimizer (genetic algorithm on own parameters) |
| Code modification | Static | Neural plasticity-inspired self-modifying code at runtime |
| Architecture | Flat modules | 17 brain regions simulating cortical-subcortical loops |
MeshCtx treats AI agent design as a neuroscience problem, not just an engineering problem.
| Repo | Visibility | Content |
|---|---|---|
| meshctx (this repo) | 🔓 Public | Security modules (full impl) + core module interface stubs (signatures + docs) |
| meshctx-core | 🔒 Private | 33 core modules full implementation (AgentSwarm · Kernel · SuperBrain · Sandbox · MultiAgent · AutonomousEngine) |
For developers: src/core/*.py contains complete interface definitions. Use from src.core.agent_swarm import AgentIdentity for type-safe integration.
Commercial: pip install meshctx-core (private repo, license required) — zero code changes needed.
# Download installer (recommended)
# https://github.com/LucyAndLuna2023/meshctx/releases/latest
# meshctx-setup.exe — NSIS wizard, 7 languages, one-click install
curl -fsSL https://raw.githubusercontent.com/LucyAndLuna2023/meshctx/main/install.sh | bash
meshctx setup # Configure API keys
meshctx start # Start web service (http://localhost:3001)
macOS 专用脚本:
curl -fsSL .../install-mac.sh | bash。 安装脚本默认英文显示;支持 9 语言: zh/en/ja/ko/fr/de/es/it/ar。中文用户可显式切回:MESHCTX_LANG=zh ./install.sh(macOS 同理MESHCTX_LANG=zh ./install-mac.sh;Windows 同理set MESHCTX_LANG=zh && install.bat)。
git clone https://github.com/LucyAndLuna2023/meshctx.git
cd meshctx && pip install -e .
meshctx chat # CLI mode
meshctx start # Web service (default http://localhost:3001)
meshctx chat # CLI conversation
meshctx setup # Configure API keys and models
meshctx desktop # Windows desktop client
meshctx agent # Multi-step autonomous agent
Genetic algorithm that evolves agent's own parameters: temperature, top_p, prompt style, memory weights.
Traditional AI: Store → Keyword match
MeshCtx: Pattern chunking → Emotional weighting → Hippocampal replay → Associative spread
meshctx start --port 3001 # Manager node
# Register worker on another machine
curl -X POST http://manager:3001/swarm/register \
-d '{"worker_id":"bot1","name":"Coder","capabilities":["code"]}'
# Submit complex task — auto-decompose → dispatch → parallel execute
curl -X POST http://manager:3001/swarm/execute \
-d '{"task":"Research best practices + write code + review","type":"research"}'
WeChat Enterprise · Feishu · Telegram · Slack · Discord · WhatsApp
Per day/week/month tracking: sessions · messages · tokens · latency · error rate
Multi-API key rotation: round_robin · least_used · random · auto-exhaustion detection
| Version | Highlights | Tests |
|---|---|---|
| v2.37 | Credential pool rotation | 825 |
| v2.40 | Human-like memory (6 mechanisms) | 916 |
| v2.41 | Self-healing ops engine | 935 |
| v2.42 | Hooks engine (8 events, Claude Code parity) | 956 |
| v3.115 | DeepSeek TUI competitor (14 modules, 4200 lines) | 130 |
| v3.116 | Open-source agent framework (RAG+RRF, Sandbox, GenomicOptimizer, Observability) | 3404 |
meshctx/
├── src/
│ ├── main.py # FastAPI main app
│ ├── web_ui.py # Web UI templates
│ ├── cli.py # CLI commands
│ ├── i18n.py # 10-language i18n
│ └── core/ # Core modules
│ ├── hybrid_reasoning.py # Free energy reasoning
│ ├── observability.py # Span/TraceLogger
│ ├── rag_orchestrator.py # RAG + RRF fusion
│ ├── terminal_sandbox.py # Security sandbox
│ ├── genomic_optimizer.py # Genetic algorithm engine
│ ├── memory_v5.py # 4-tier memory injection
│ └── ... # 14 modules total
├── tests/ # 3404 tests
├── docs/ # Documentation site
└── install.sh # One-click install
| Endpoint | Method | Description |
|---|---|---|
/api/chat | POST | Conversation (JSON) |
/api/chat/stream | POST | Streaming (SSE) |
| Endpoint | Method | Description |
|---|---|---|
/api/dual/plan | POST | Planner planning |
/api/dual/execute | POST | Executor execution |
/api/dual/stats | GET | Session stats |
| Endpoint | Method | Description |
|---|---|---|
/api/memory/stats | GET | Memory diagnostics |
/api/memory/add | POST | Add memory |
/api/memory/search | POST | Search memories |
| Endpoint | Method | Description |
|---|---|---|
/swarm/register | POST | Register worker |
/swarm/execute | POST | Submit swarm task |
/swarm/status | GET | Swarm status |
| Endpoint | Method | Description |
|---|---|---|
/api/subagent/run | POST | Launch isolated subagent |
/api/subagent/{id}/status | GET | Query status |
| Platform | Install | Status |
|---|---|---|
| Windows | NSIS installer (10 languages) | ✅ |
| Linux | curl|bash script | ✅ |
| macOS | DMG + Homebrew | ✅ |
| WSL | Same as Linux | ✅ |
| Docker | docker-compose | ⚠️ WIP |
We welcome contributions! Here's how:
git checkout -b feature/amazing-thingfeat: add thalamic gating filterpython -m pytest tests/ -xgit clone https://github.com/LucyAndLuna2023/meshctx.git
cd meshctx
pip install -e ".[dev]"
python -m pytest tests/ -x
⭐ Star this repo if you find it useful!
Built with 🧠 by LucyAndLuna2023
22 commits
Python
94.2%
HTML
3.3%
Shell
1.9%