A cognitive architecture for AI agents — not just a code library, but a framework for building agents that have memory, have judgment, and get better every time.
中文版 README | English
A production-tested framework extracted from a real multi-agent system running daily since 2025. It provides four interlocking systems that together form a complete cognitive architecture:
| System | Question it answers | What it does |
|---|---|---|
| Three-Doc System v2.0 | "How to record" | Minimal-document project management with causal knowledge graphs |
| Thought Imprint v5.0 | "How to judge" | Behavioral boundary principles in "first X, then Y" judgment-tendency format |
| Gene Module | "How to think" | Extracted cognitive instincts injected before skills as cognitive prerequisites |
| Promotion Chain | "How to evolve" | Self-improvement pipeline: lessons → skills → principles → constitution |
Execute a task
↓ accumulate experience
lessons (experience)
↓ same-topic ≥3 times
skills (procedures) ←── Gene module injects cognitive ability
↓ repeatedly validated + cross-domain
Thought Imprint (behavioral principles)
↓ stable ≥30 days + proven fundamental
SOUL Constitution
Start with docs/cognitive-architecture.md — it explains how the four systems connect.
| If you want to... | Read |
|---|---|
| Structure your agent project documentation | docs/three-doc-system-v2.md |
| Define behavioral boundaries for your agent | docs/thought-imprint-v5.md |
| Extract cognitive patterns from agent operation | docs/gene-module.md |
| Build a self-improving knowledge pipeline | examples/promotion-chain-example.md |
| Set up multi-agent collaboration | docs/three-system.md |
# Copy the agent templates
cp templates/AGENTS.md your-project/
cp templates/SOUL.md your-project/
cp templates/TOOLS.md your-project/
# Copy the gene module template
cp genes/GENES-template.md your-project/GENES.md
# Copy the system core template
cp examples/SYSTEM_CORE-template.md your-project/AGENT_SYSTEM_CORE.mdSOUL.md— Define your agent's identity, axioms, and constraintsAGENTS.md— Define workspace rules and skill frameworkGENES.md— Start empty; genes are extracted after ≥30 days of operationAGENT_SYSTEM_CORE.md— Fill in architecture, leave "Cognitive Genes" as "Observation period"
endpointstar-framework/
├── docs/ # Methodology documents
│ ├── cognitive-architecture.md # ★ Four-system unified specification
│ ├── three-doc-system-v2.md # ★ Three-document system v2.0
│ ├── thought-imprint-v5.md # ★ Thought imprint v5.0
│ ├── gene-module.md # ★ Gene module application architecture
│ ├── three-system.md # Three-system collaboration architecture
│ ├── multi-agent.md # Multi-agent coordination
│ └── inter-brain.md # Inter-brain communication protocol
├── templates/ # Sanitized configuration templates
│ ├── AGENTS.md # Workspace specification
│ ├── SOUL.md # Personality definition
│ ├── TOOLS.md # Tool configuration (fill in your info)
│ ├── USER.md # User profile (fill in your info)
│ └── IDENTITY.md # Agent identity
├── genes/ # Cognitive gene module
│ └── GENES-template.md # Gene template with examples
├── examples/ # Worked examples
│ ├── SYSTEM_CORE-template.md # System core with cognitive gene section
│ └── promotion-chain-example.md # How knowledge moves up the chain
├── lessons/ # Production lessons learned
│ ├── README.md # Lesson index
│ ├── infrastructure.md # Infrastructure (7 entries)
│ ├── ai-model.md # AI model handling (8 entries)
│ ├── workflow.md # Workflow patterns (10 entries)
│ └── security.md # Security (8 entries)
└── CHANGELOG.md
Every agent action flows through a cognitive chain:
Thought Imprint → provides judgment tendency ("verify before concluding")
Gene Module → provides cognitive instinct ("unverifiable source → discard")
Three-Doc System → records execution process (writes to WORKFLOW.md)
Result:
Success → may strengthen existing genes
Failure → writes to lessons/ → may trigger promotion chain
- No fabrication — If you can't do it, say you can't
- Reversible first —
trashoverrm, backup over direct edit - Infrastructure first — When search/channels/models break, stop and fix first
- Write it down — "Mental notes" don't survive restarts; files do
- Delegation closes the loop — Dispatched tasks must have timeout, feedback, fallback
A piece of information enters long-term memory only if: without this record, the next conversation would not know about it.
- User preferences and decision logic → must record
- One-time debugging solutions → don't record
- Cross-project lessons and patterns → must record
This framework's philosophical foundation comes from Isaac Asimov's Foundation series:
- Endpoint Star (Terminus) = Knowledge preserver, seed of civilization rebuilding
- Seldon's Axiom = The agent's core behavioral principle
- Encyclopedia Galactica = The memory system
- Seldon Crisis = Every system crash and deployment failure
Extracted from a real multi-AI-agent production system running multiple agents (a primary dispatcher, a deep-reasoning agent, and a system-maintenance agent). The framework evolved through 3 iterations (v1.0 → v3.0) over 8 months of daily operation, driven by practical needs and hard-won lessons — including a critical "hallucination loop" failure where a fake r²=0.778 model was discovered and replaced with an honest r²=0.207 model.
MIT — Free to use, modify, and share.
Framework extracted from production AI Agent deployment | 2025-2026