Dong AI Company — 多智能体 AI 公司框架
Project description
Dong AI Company
Cross-project memory and organizational governance for AI agents.
pip install dong-ai
dong demo # see it in action — no API key, no network calls
dong setup # configure providers
dong make "a quarterly market analysis"
See it in action (no API key required)
dong demo creates two fake projects in an isolated local SQLite database and shows
how graph memory enables cross-project search, symbol drill-down, dependency impact
analysis, and session resume. Zero config, zero API key, zero network calls.
The Problem
Every AI agent works in a vacuum. Close a conversation, lose the context. Start a new project, the model has no memory of last week's architecture decisions. Long-running projects degrade into incoherence as the window fills with noise.
Dong AI solves this by adding two missing layers to any agent:
- Cross-project indexed memory — every symbol, decision, and dependency is stored in a queryable graph that persists across sessions. The model fetches what it needs instead of scrolling through degraded history.
- Organizational governance — red/blue debate before design decisions, dynamic worker recruitment per task, board review with quality gates, and automated post-project debrief that extracts lessons for future work.
The result: agents that remember what they built, why they built it that way, and improve with every project.
Quick Start
pip install dong-ai # zero external AI deps
dong setup # detect hardware, configure providers
dong make "a CLI tool for CSV parsing"
No API key required to start — dong check shows available options.
All Commands
| Command | Use |
|---|---|
dong make "request" |
Self-directed execution for any domain |
dong run "request" |
Full governance pipeline (debate → workers → review) |
dong quick "task" |
Lightweight mode, no pipeline overhead |
dong analyze <path> 'question' |
Read and analyze any source file |
dong edit <path> 'instruction' |
Edit file with diff preview |
dong debug |
CI failure root cause analysis |
dong company start --domain "..." --duration 8h |
Background company runtime |
dong company status |
View running company state |
dong company knowledge |
Organizational metacognition map |
dong company review |
Decision audit trail |
dong graph list |
List indexed graph projects |
dong graph view <id> |
Drill into a project's symbols and dependencies |
dong detect |
Full system status |
dong serve |
OpenAI-compatible API server |
dong update |
Upgrade from PyPI |
How It Works
Any Agent (CLI / Hermes / Claude Code / Cursor / Copilot)
│ shell out: dong <command>
│
▼
Dong AI Engine
│
├── Column Memory 5-slot context management (C0-C4) with unloading
├── Graph Memory Persistent symbol/dependency/decision index
├── Experience Engine Post-project debrief → skill extraction → future recall
├── SafetyGovernor Confidence scoring, risk budgets, confirmation gates
├── Metacognition Knowledge map, strategy evolution, improvement tracking
└── Domain Runtimes 7x24 background operation for monitoring tasks
Column Memory
Not "infinite context" — precise context. Five named columns with independent token budgets:
| Column | Content | Reason to keep |
|---|---|---|
| C0 | Project goal, constraints, user | Always available |
| C1 | Symbol signatures, API contracts | Reference surface |
| C2 | Dependency maps, architecture | Navigation |
| C3 | Active decisions, rationale | Traceability |
| C4 | Historical context, past output | Full when room |
When the budget is tight, C4 is unloaded first. The model always has the current goal, available symbols, and recent decisions — without wading through 50K of conversation history.
Graph Memory
Every project run indexes its symbols, dependencies, and decisions into an SQLite graph. Three retrieval methods:
- Keyword match — exact signature lookup
- Semantic search — embedding cosine similarity
- Graph traversal — dependency chain walking
Impact analysis on every query: load_config → 2 callers, risk score: 50%.
Projects don't exist in isolation. Symbols from one project can be referenced by another. Cross-project queries work across your entire work history.
Governance Pipeline
User Request
│
├── CEO — type detection, pipeline generation, worker recruitment
├── Design — red/blue team debate, requirements extraction, coverage checklist
├── Execute — dynamic workers, parallel execution, self-healing (×3), cross-review
├── Board — phase scoring (1-10), minimum gate 6.0, requirement audit
├── Debrief — lesson extraction → Experience Engine
└── Report — full evidence trail
No hardcoded roles. Each task generates its own specialist team via LLM — software projects get architects and engineers, novels get world-builders and writers, audits get security analysts.
Capabilities
| Category | Description |
|---|---|
| Project execution | Three modes: make (self-directed research→execute), run (full governance), quick (lightweight) |
| Code workflow | analyze (code Q&A), edit (diff-preview edits), debug (CI root cause from GitHub Actions) |
| Company runtime | 7x24 background domains, configurable duration, hourly health checks, daily reports |
| Metacognition | Knowledge map of domain expertise, learning strategy effectiveness, knowledge gaps |
| Governance | Confidence scoring, risk budgets, confirmation gates, decision audit trail |
| Context | 5-column memory management, cross-project graph memory, session recovery |
| Plugins | MCP ecosystem integration, plugin registry |
| Models | 20+ providers with automatic failover, local GGUF support, custom provider config |
| API | OpenAI-compatible server, webhook subscriptions, scheduled cron tasks |
Why Not Just Use a Bigger Context Window?
Larger windows don't solve the structural problem — the model still has to search through noise to find signal, and the window is reset when the conversation ends.
Dong AI's approach is orthogonal: index instead of remember. A 1K-2K precision query replaces 50K of degraded context. Cross-session persistence replaces per-session ephemeral state. This works regardless of window size — 64K, 128K, or 1M.
Integration
Dong AI is designed to be called from any agent that can run shell commands.
| Agent | Method |
|---|---|
| Hermes Agent | cp SKILL.md ~/.hermes/skills/dong-ai-company/ |
| Claude Code | cp CLAUDE.md ~/.claude/claude.md |
| Cursor | cp .cursorrules .cursorrules |
| GitHub Copilot | .github/copilot-instructions.md |
| Any | dong <command> from shell |
Adapter files are maintained at Dong04-123/Dong-AI-skill.
Testing
pip install pytest
pytest tests/
# 281 tests, ~2s, zero external deps, no network calls, no API keys
Project Status
Active development. v0.1.x — core pipeline, column memory, experience engine, governance, company runtime, and multi-agent adapters are functional. Breaking changes possible until v1.0.
License
MIT — free for personal, research, and commercial use. Attribution required.
██████╗ ██████╗ ███╗ ██╗ ██████╗ █████╗ ██╗
██╔══██╗██╔═══██╗████╗ ██║██╔════╝ ██╔══██╗██║
██║ ██║██║ ██║██╔██╗ ██║██║ ███████║██║
██║ ██║██║ ██║██║╚██╗██║██║ ██╔══██║██║
██████╔╝╚██████╔╝██║ ╚████║╚██████╗ ██║ ██║██║
╚═════╝ ╚═════╝ ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝╚═╝
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dong_ai-0.2.7-py3-none-any.whl.
File metadata
- Download URL: dong_ai-0.2.7-py3-none-any.whl
- Upload date:
- Size: 129.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b670aee849b2f05e97760ae4dac54c8cd0394fa908c57b17fe9d33eb237caf5c
|
|
| MD5 |
28e7cd030dd5e314e3300c9d62a1a332
|
|
| BLAKE2b-256 |
145548ebd3fd7deb5cf09414846b9553fcbd9fae3b21faec14cea4b0df6dc168
|