Open-Source AI Digital Company Platform β Let AI Teams Collaborate Like Real Ones
π¨π³ δΈζζζ‘£ | π₯οΈ Live Demo | Quick Start | Features | Architecture | Comparison | Docs | Contributing
Foundry is an open-source AI-powered digital company platform. Unlike agent frameworks where you have to orchestrate everything yourself, Foundry provides a ready-to-use AI company β just input a strategic goal and the AI company runs autonomously.
π‘ In one sentence: If CrewAI is "building blocks for agents", Foundry is "the company already built."
Typical scenario: You say "Analyze competitors and create a report" in a group chat. The CEO Agent automatically breaks down the task, assigns it to the analysis department, executes in parallel, and summarizes the results β all you need to do is approve key decisions.
| Registration | Organization Chart |
|---|---|
![]() |
![]() |
| Group Chat | Admin Dashboard |
|---|---|
![]() |
![]() |
| Requirement | Minimum | Recommended |
|---|---|---|
| OS | Windows 10+, macOS 12+, Ubuntu 20.04+ | Any 64-bit OS |
| CPU | 2 cores | 4+ cores |
| RAM | 8 GB | 16 GB |
| Disk | 5 GB free | 10 GB+ free |
| Docker | 20.10+ | Latest stable |
| Node.js | 20+ | 22 LTS |
| pnpm | 10+ | Latest |
π‘ Disk breakdown: Project ~1.5 GB + Docker images ~1 GB + build cache ~1 GB. SSD recommended for faster Docker startup.
All infrastructure runs in Docker β you don't need to install these separately:
| Service | Purpose | Docker Image |
|---|---|---|
| PostgreSQL 18 | Main database | postgres:18-alpine |
| Redis 7 | Cache & sessions | redis:7-alpine |
| RabbitMQ 3 | Message queue | rabbitmq:3-management |
| Consul | Service discovery | consul:latest |
| Nginx | Reverse proxy | nginx:alpine |
git clone https://github.com/axislab-top/Foundry.git && cd Foundry
pnpm setup:dev # env β install β docker β db β start# 1. Clone the repository
git clone https://github.com/axislab-top/Foundry.git && cd Foundry
# 2. Install dependencies
pnpm install
# 3. Configure environment
node -e "fs.copyFileSync('env.shared.example','.env.shared')"
# 4. Generate service .env files
node scripts/env-manager.js
# 5. Start infrastructure (PostgreSQL, Redis, RabbitMQ)
pnpm infra:start
# 6. Initialize database
node scripts/bootstrap-db.js
# 7. Start development server
pnpm devβ±οΈ First launch takes 5-10 minutes β Docker needs to download all images (~2 GB). Subsequent starts take ~30 seconds.
π‘ Windows users: Run
pnpm setup:devdirectly in cmd or PowerShell. Run as Administrator if you encounter permission errors.
π¨π³ China users: Docker Hub may be inaccessible. Configure mirror accelerator in Docker Desktop β Settings β Docker Engine:
{ "registry-mirrors": ["https://docker.1ms.run", "https://docker.xuanyuan.me"] }Then restart Docker Desktop before running setup.
After containers are healthy and migrations complete, visit:
| Service | URL | Description |
|---|---|---|
| π₯οΈ Client UI | http://localhost:5173 | Main interface (Vite dev server) |
| π§ Admin Panel | http://localhost:3105 | Administrator dashboard |
| π‘ API Service | http://localhost:3000/api-docs | API Swagger docs |
| π‘ Gateway | http://localhost:3002/api-docs | Gateway Swagger docs |
| π Grafana | http://localhost:4000 | Log visualization (admin/admin) |
| π° RabbitMQ | http://localhost:15672 | Message queue management (guest/guest) |
The admin account is automatically created on first startup:
| Field | Value |
|---|---|
admin@example.com |
|
| Username | admin |
| Password | changeme |
β οΈ ChangeDEFAULT_ADMIN_PASSWORDin production environments.
| Service | URL | Username | Password |
|---|---|---|---|
| π§ Admin Panel | http://localhost:3105 | admin |
changeme |
| π Grafana | http://localhost:4000 | admin |
admin |
| π° RabbitMQ | http://localhost:15672 | guest |
guest |
pnpm infra:status # Check container status
pnpm infra:logs # View container logs
pnpm infra:stop # Stop all containers
pnpm infra:restart # Restart all containers| Problem | Solution |
|---|---|
| Port already in use | Run pnpm infra:stop first, or change ports in env.shared.example |
| Docker not running | Start Docker Desktop and wait for it to be ready |
| Out of memory | Increase Docker memory limit to 8 GB+ in Docker Desktop settings |
| Slow on Windows | Enable WSL 2 backend for Docker Desktop |
getaddrinfo ENOTFOUND postgres |
You have a stale .env file with Docker hostnames. Delete .env and re-run pnpm setup:dev |
RabbitMQ ACCESS_REFUSED |
RabbitMQ container was created with wrong credentials. Run pnpm infra:stop then pnpm setup:dev again |
| Database connection timeout | PostgreSQL may be slow to start on Windows. The app will retry automatically (10s timeout) |
| Docker image pull timeout | Configure mirror accelerator (see below) or pull images manually: node scripts/pull-docker-images.js |
If you see errors like failed to fetch anonymous token or content not found:
-
Configure Docker Mirror (recommended):
- Docker Desktop β Settings β Docker Engine
- Add to JSON:
{ "registry-mirrors": [ "https://docker.1ms.run", "https://docker.xuanyuan.me" ] }- Click "Apply & restart"
-
Pull images manually (if mirror doesn't work):
node scripts/pull-docker-images.js
-
Pull specific image (if only one fails):
docker pull node:20-alpine docker pull node:20-bookworm-slim
π‘ Diagnose database issues: Run
node scripts/diagnose-db.jsin a separate terminal while the project is running.
After completing the steps above:
# 1. Login to Admin Panel at http://localhost:3105
# Email: admin@example.com Password: changeme
# 2. Configure LLM Keys (required for AI agents):
# Admin Panel β LLM Keys β Add your OpenAI/Claude API key
# 3. Open Client UI at http://localhost:5173
# Register a new account or login to start using the platform| Item | Where to Configure | Why |
|---|---|---|
| LLM API Keys | Admin Panel β LLM Keys | Required for AI agents to work |
| Company Info | Admin Panel β Company | Your company name and industry |
| Agent Skills | Admin Panel β Skills | Enable/disable and configure skills |
| Email Settings | Admin Panel β Settings | For notifications (optional) |
π‘ Tip: After logging into the Admin Panel, go to LLM Keys first and add at least one API key (OpenAI, Claude, etc.) β otherwise AI agents won't be able to respond.
ποΈ One-Click Company Creation β Input name and industry, auto-generate org structure
- Auto-generates Board β CEO β Department Head β Employee Agent hierarchy
- Built-in industry templates for one-click company initialization
- Drag-and-drop custom organization structure
π€ Multi-Agent Collaboration β Each agent has a role, like a real team
- CEO Agent handles strategic breakdown and task assignment
- Department Head Agent manages sub-task orchestration
- Employee Agent executes tasks (Skills, APIs, code execution)
- Customizable agent roles and capabilities
π¬ Real-time Group Chat β Not just conversations, true collaboration
- Dynamic group chat + streaming output + @mentions
- Human-in-the-loop approval flow (critical decisions need your confirmation)
- Real-time task progress push notifications
- Multi-company, multi-group-chat parallel operation
π§ Layered Memory System β Your AI company "learns"
- 3-tier memory: Company / Department / Agent level
- RAG intelligent retrieval (powered by pgvector)
- Automatic memory consolidation and decay
- Cross-session context preservation
π Autonomous Operation β No need to watch it constantly
- CEO Agent periodic Heartbeat review of pending tasks
- Task auto-breakdown β assignment β execution β reporting
- Temporal workflow engine ensures reliability
- Scheduled tasks and event-driven support
π° Cost & Governance β Every penny accounted for
- Real-time token consumption and cost tracking
- Company-level budget control
- Intelligent model routing (auto-select best cost-performance ratio)
- Full audit logging
- LLM Key pool management (multi-key rotation)
graph TB
subgraph user["π€ User Layer"]
chat["π¬ Chat UI<br/><i>Real-time WebSocket</i>"]
admin["π₯οΈ Admin Panel<br/><i>Management Dashboard</i>"]
end
nginx["π Nginx Reverse Proxy + SSL"]
subgraph gateway["πͺ Gateway Β· port 3002"]
gw_auth["π JWT Auth + RBAC"]
gw_ws["π Socket.IO Hub"]
gw_security["π‘οΈ HMAC / CSRF / Rate Limit"]
gw_route["π Dynamic Route Proxy"]
end
subgraph services["βοΈ Application Services"]
api["π‘ API Service Β· port 3000<br/><b>Business Control Plane</b><br/>46 entities Β· RLS multi-tenancy<br/>Billing Β· Memory+RAG Β· Skills"]
worker["π§ Worker Service Β· port 3004<br/><b>AI Orchestration Engine</b><br/>LangGraph Pipelines Β· Task Scheduler<br/>Tool Registry Β· Memory Consolidation"]
webhook["πͺ Webhook Service Β· port 3003<br/>External event receive/forward/retry"]
end
subgraph infra["ποΈ Infrastructure"]
pg[("π PostgreSQL + pgvector<br/>RLS multi-tenancy Β· 46 tables<br/>Vector embeddings")]
redis[("β‘ Redis 7<br/>Cache Β· Session Β· Pub/Sub")]
rabbitmq[("π RabbitMQ<br/>Event Bus Β· RPC Queues<br/>15 event domains")]
minio[("π¦ MinIO / S3 / OSS<br/>File storage")]
temporal["β±οΈ Temporal<br/>Heartbeat fanout Β· Approval wait<br/>Supervisor review"]
grafana["π Grafana Stack<br/>Loki Β· Promtail Β· Grafana"]
end
subgraph runners["π Execution"]
runner["π Runner Β· gVisor Sandbox<br/>Code execution Β· Command policy<br/>K8s Jobs isolation"]
end
chat --> nginx
admin --> nginx
nginx --> gateway
gw_ws -- "Redis Pub/Sub<br/>collab:notify" --> redis
gw_route -- "RPC proxy" --> api
gw_route -- "RPC proxy" --> webhook
api <== "RPC<br/>api-rpc-queue" ==> worker
worker ==>|"RPC sandbox"| runner
runner ==>|"RPC token"| api
api --> pg
api --> redis
api --> rabbitmq
worker --> rabbitmq
webhook --> rabbitmq
api --> minio
worker --> pg
style user fill:#e3f2fd,stroke:#1565c0,color:#000
style gateway fill:#fff3e0,stroke:#e65100,color:#000
style services fill:#e8f5e9,stroke:#2e7d32,color:#000
style infra fill:#f3e5f5,stroke:#6a1b9a,color:#000
style runners fill:#fce4ec,stroke:#b71c1c,color:#000
The CEO Agent runs on a ~30min autonomous cycle β no human prompt needed. Each cycle gathers context from 7 sources, plans via LLM, creates tasks, and streams a report back to chat.
graph LR
subgraph cycle["β° Autonomous Heartbeat Cycle"]
A["π TaskHeartbeatScheduler<br/><i>Round-robin across companies</i>"]
B["π₯ Ingest Context<br/>Dashboard Β· Memory RAG<br/>Budgets Β· Tasks Β· Lessons<br/>Org tree Β· Model routing"]
C["π§ CEO LLM Plan<br/><i>Structured output + Zod repair</i><br/>nextStep: generate_tasks | summary_only"]
D["β
Validate & Persist<br/>Create tasks via API RPC<br/>Pull agents into rooms"]
E["π Summarize & Notify<br/>Stream report to chat room<br/>Store in memory Β· Request approval"]
F["πΎ Memory + Approval"]
end
A -- "~30min" --> B
B --> C
C --> D
D --> E
E --> F
F -.->|"repeat"| A
style cycle fill:#fffde7,stroke:#f57f17,color:#000
User messages trigger a LangGraph state machine with 4 intent paths and a human-in-the-loop approval gate (interrupt/resume).
graph TB
msg["π¬ User message in chat<br/><i>@CEO or @Agent</i>"]
subgraph pipeline["CollaborationRoomPipeline Β· LangGraph"]
classify["π― CEO LLM<br/>Classify Intent"]
discuss["π¬π¬π¬ Discussion<br/><i>Multi-agent moderated</i>"]
direct["π€ Single Reply<br/><i>@Agent direct answer</i>"]
execute["π Task Execution<br/><i>CEO breaks down into tasks</i>"]
gate["βΈοΈ Approval Gate<br/><i>LangGraph interrupt()</i><br/>Waits for human decision"]
approve{"π€ Human<br/>Approve?"}
end
out["Agent responses β API persist<br/>β Redis Pub/Sub β Socket.IO<br/>β Client (200-char streaming chunks)"]
msg --> classify
classify -->|"discussion"| discuss
classify -->|"direct"| direct
classify -->|"execution"| execute
classify -->|"approval"| gate
gate --> approve
approve -- "β
ζΉε/approve" --> execute
approve -- "β ζη»/reject" --> out
discuss --> out
direct --> out
execute --> out
style pipeline fill:#e8eaf6,stroke:#283593,color:#000
style gate fill:#fff9c4,stroke:#f9a825,color:#000
The full lifecycle: from user goal to agent execution, cost tracking, failure review, and memory feedback β forming a self-improving loop.
graph TB
subgraph trigger["π― Triggers"]
user["π¬ User @CEO in chat"]
heartbeat["β° Heartbeat ~30min"]
webhook_trig["πͺ External Webhook"]
end
plan["π§ CEO LLM<br/>Break down goal into tasks<br/><i>Structured output + Zod repair</i>"]
assign["π Task Assignment<br/>DAG: parent β sub-tasks<br/>Assign to department agents"]
subgraph exec["βοΈ Agent Execution"]
agent["π€ Agent LLM<br/>Execute with skills + context"]
skills["π§ Skill Engine<br/>Tool calling (function schema)"]
runner["π Runner Sandbox<br/>gVisor K8s Job"]
end
result{{"β
β Task Result"}}
subgraph cost["π° Cost Control"]
billing["π Token Billing<br/>per LLM call"]
budget["π΅ Budget Check<br/>company / dept / agent"]
degrade["π Model Degradation<br/>fallback to cheaper model"]
pause["π« Budget Exceeded<br/>pause autonomous ops"]
end
subgraph feedback["π Memory Feedback Loop"]
sup["π Supervisor Review<br/>Post-mortem on failures"]
lessons["π Lessons Learned<br/>LLM-generated insights"]
memory["π§ Memory RAG<br/>pgvector embeddings<br/>company β dept β agent"]
end
chat_out["π¬ Streaming Report<br/>β Chat Room (200-char chunks)<br/>β Socket.IO β Client"]
trigger --> plan
plan --> assign
assign --> exec
agent --> skills
skills -->|"code/commands"| runner
runner --> result
agent --> result
result -->|"completed"| chat_out
result -->|"failed"| sup
sup --> lessons
lessons --> memory
memory -.->|"RAG search<br/>next heartbeat"| plan
agent --> billing
billing --> budget
budget -->|"warning"| degrade
budget -->|"exceeded"| pause
degrade -.->|"cheaper model"| agent
style trigger fill:#e3f2fd,stroke:#1565c0,color:#000
style cost fill:#fff3e0,stroke:#e65100,color:#000
style feedback fill:#e8f5e9,stroke:#2e7d32,color:#000
style exec fill:#f3e5f5,stroke:#6a1b9a,color:#000
π Full architecture documentation β docs/ARCHITECTURE.md
| Feature | Foundry | CrewAI | MetaGPT | ChatDev | AutoGen |
|---|---|---|---|---|---|
| Positioning | AI Digital Company Platform | Agent Orchestration Framework | AI Software Company | Zero-code Dev Platform | Agent Programming Framework |
| Ready to Use | β Complete platform | β Needs orchestration | β Needs coding | ||
| Real-time Chat | β WebSocket | β | β | β | β |
| Org Chart Visualization | β Drag-and-drop | β | β | ||
| Layered Memory | β 3-tier + RAG | β | β | β | β |
| Cost Control | β Budget + Routing | β | β | β | β |
| Multi-tenancy | β RLS isolation | β | β | β | β |
| Approval Flow | β Human-in-loop | β | β | β | β |
| Admin Panel | β Separate frontend | β | β | β | β Studio |
| Tech Stack | NestJS + React | Python | Python | Python | Python + .NET |
| License | GPL-3.0 | MIT | MIT | Apache-2.0 | MIT |
π‘ Key difference: Competitors are "frameworks" β you write code to orchestrate agents. Foundry is a "platform" β register and use it. Like the difference between Slack and IRC.
| Layer | Technology |
|---|---|
| Backend | NestJS (TypeScript) Β· 7 microservices |
| Frontend | React 18 Β· Vite Β· TypeScript |
| Build | pnpm workspace Β· Turborepo |
| Database | PostgreSQL (TypeORM + RLS multi-tenancy) Β· pgvector |
| Message Queue | RabbitMQ |
| Cache | Redis |
| AI Orchestration | LangChain Β· LangGraph |
| Real-time | Socket.IO (WebSocket) |
| Object Storage | MinIO / S3 / OSS / Local |
| Workflow | Temporal (optional) |
| Containerization | Docker Compose |
Foundry/
βββ apps/ # Microservices
β βββ api/ # API service (core business)
β βββ gateway/ # Gateway (auth, rate limiting, routing)
β βββ worker/ # Background tasks
β βββ webhooks/ # Webhook handling
β βββ runner/ # Code execution sandbox
β βββ temporal-worker/ # Temporal workflows
β βββ logging/ # Logging service
βββ admin-system/ # Admin panel frontend
βββ client-frontend/ # Client frontend
βββ packages/ # Shared packages (messaging, security, tenant...)
βββ infrastructure/ # Infrastructure configs
βββ contracts/ # Event contracts & OpenAPI
βββ deployment/ # Docker Compose deployment
βββ docs/ # Documentation
Core configuration is documented in env.shared.example. Key variables:
# π΄ Required (production)
JWT_SECRET=<openssl rand -base64 32>
DB_PASSWORD=<strong-password>
DEFAULT_ADMIN_PASSWORD=<strong-password>
# π‘ Optional
TEST_AUTH_ENABLED=false # Test user injection (dev only)
FILE_UPLOAD_MAX_SIZE=52428800 # File upload limit 50MB
KIBANA_ENCRYPTION_KEY=<key> # Kibana (if using ELK)Q: How is Foundry different from CrewAI/AutoGen?
CrewAI/AutoGen are agent orchestration frameworks β you write Python code to define agents, set up tools, and orchestrate workflows.
Foundry is an AI digital company platform β you register, create a company, and the AI runs automatically. No coding required.
Analogy: CrewAI is like building a PC from parts. Foundry is like buying a ready-to-use computer.
Q: Which AI models are supported?
Through LLM Key pool management, all major models are supported: OpenAI, Anthropic Claude, Azure OpenAI, and Chinese models (Qwen, Wenxin, etc.). Features multi-key rotation and intelligent routing.
Q: Can I use it commercially?
Yes. This project is open-sourced under GPL-3.0. Commercial use requires compliance with GPL-3.0 terms (derivative works must also be open-sourced). Contact us for commercial licensing.
Q: How is data security ensured?
- Multi-tenant RLS (Row-Level Security) isolation
- LLM Key encrypted storage (AES-256-GCM)
- JWT + RBAC access control
- Full audit logging
- All credentials managed via environment variables, never hardcoded
Q: What are the minimum hardware requirements?
- Development: 4GB RAM + 2 CPU (Docker)
- Production: 8GB RAM + 4 CPU (recommended)
- Storage: PostgreSQL + Redis + RabbitMQ + MinIO
We welcome all forms of contribution!
| Type | How |
|---|---|
| π Bug Report | Open an Issue |
| π‘ Feature Request | Open an Issue |
| π Documentation | Submit a PR directly |
| π§ Code | Fork β Branch β PR |
See CONTRIBUTING.md for details.
This project is licensed under GPL-3.0.
If you find this useful, please give us a β Star!
β Star β’
π΄ Fork β’
π Report Bug



