agi-framework 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- agi-framework-0.2.0/LICENSE +21 -0
- agi-framework-0.2.0/PKG-INFO +564 -0
- agi-framework-0.2.0/README.md +541 -0
- agi-framework-0.2.0/agents/__init__.py +19 -0
- agi-framework-0.2.0/agents/base_agent.py +311 -0
- agi-framework-0.2.0/agents/crew.py +362 -0
- agi-framework-0.2.0/agi_framework.egg-info/PKG-INFO +564 -0
- agi-framework-0.2.0/agi_framework.egg-info/SOURCES.txt +46 -0
- agi-framework-0.2.0/agi_framework.egg-info/dependency_links.txt +1 -0
- agi-framework-0.2.0/agi_framework.egg-info/entry_points.txt +3 -0
- agi-framework-0.2.0/agi_framework.egg-info/requires.txt +18 -0
- agi-framework-0.2.0/agi_framework.egg-info/top_level.txt +14 -0
- agi-framework-0.2.0/algorithms/__init__.py +5 -0
- agi-framework-0.2.0/algorithms/advanced_algorithms.py +328 -0
- agi-framework-0.2.0/algorithms/core_algorithms.py +329 -0
- agi-framework-0.2.0/core/__init__.py +5 -0
- agi-framework-0.2.0/core/agent_executor.py +335 -0
- agi-framework-0.2.0/core/agi_engine.py +346 -0
- agi-framework-0.2.0/core/self_improvement_engine.py +434 -0
- agi-framework-0.2.0/data/__init__.py +21 -0
- agi-framework-0.2.0/data/data_pipeline.py +360 -0
- agi-framework-0.2.0/evaluation/__init__.py +35 -0
- agi-framework-0.2.0/evaluation/benchmark_runner.py +310 -0
- agi-framework-0.2.0/evaluation/benchmarks.py +463 -0
- agi-framework-0.2.0/evaluation/metrics.py +307 -0
- agi-framework-0.2.0/experiments/__init__.py +1 -0
- agi-framework-0.2.0/experiments/eval_example.py +169 -0
- agi-framework-0.2.0/experiments/train_example.py +125 -0
- agi-framework-0.2.0/infrastructure/__init__.py +34 -0
- agi-framework-0.2.0/infrastructure/advanced_infrastructure.py +449 -0
- agi-framework-0.2.0/infrastructure/distributed_training.py +357 -0
- agi-framework-0.2.0/infrastructure/observability.py +432 -0
- agi-framework-0.2.0/memory/__init__.py +11 -0
- agi-framework-0.2.0/memory/hybrid_memory.py +352 -0
- agi-framework-0.2.0/models/__init__.py +1 -0
- agi-framework-0.2.0/pyproject.toml +140 -0
- agi-framework-0.2.0/reasoning/__init__.py +16 -0
- agi-framework-0.2.0/reasoning/reasoning_patterns.py +386 -0
- agi-framework-0.2.0/setup.cfg +4 -0
- agi-framework-0.2.0/setup.py +52 -0
- agi-framework-0.2.0/tests/__init__.py +1 -0
- agi-framework-0.2.0/tests/test_integration.py +366 -0
- agi-framework-0.2.0/tools/__init__.py +1 -0
- agi-framework-0.2.0/training/__init__.py +21 -0
- agi-framework-0.2.0/training/advanced_training.py +395 -0
- agi-framework-0.2.0/training/training_systems.py +336 -0
- agi-framework-0.2.0/utils/__init__.py +29 -0
- agi-framework-0.2.0/utils/helpers.py +233 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Tuan Tran (tuanthescientist)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,564 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: agi-framework
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Advanced General Intelligence System with self-awareness and meta-learning
|
|
5
|
+
Home-page: https://github.com/tuanthescientist/AGI
|
|
6
|
+
Author: Tuan Tran
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: Science/Research
|
|
16
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
17
|
+
Requires-Python: >=3.8
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
Provides-Extra: torch
|
|
20
|
+
Provides-Extra: tensorflow
|
|
21
|
+
Provides-Extra: dev
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
|
|
24
|
+
# AGI Framework
|
|
25
|
+
## A modular, graph-based framework towards self-improving AGI systems
|
|
26
|
+
|
|
27
|
+
**Author**: Tuan Tran
|
|
28
|
+
**Version**: 0.2.0
|
|
29
|
+
**License**: MIT
|
|
30
|
+
|
|
31
|
+
A comprehensive, production-ready framework for building self-aware, self-improving AGI systems with advanced reasoning, memory systems, and autonomous agents. Bridging LLM capabilities with structured reasoning, meta-learning, and multi-agent collaboration.
|
|
32
|
+
|
|
33
|
+
## ๐ฏ Core Vision
|
|
34
|
+
|
|
35
|
+
Going beyond traditional LLMs by combining:
|
|
36
|
+
- **Graph-Based Agent Architecture**: State graph orchestration (inspired by LangGraph) with explicit nodes and transitions
|
|
37
|
+
- **Self-Awareness & Meta-Learning**: Continuous introspection and autonomous capability improvement
|
|
38
|
+
- **Advanced Reasoning**: ReAct, Chain-of-Thought, Tree-of-Thoughts, Self-Reflection, Meta-Reasoning patterns
|
|
39
|
+
- **Hybrid Memory System**: Vector DB (semantic), Graph DB (knowledge), episodic, procedural, and working memory
|
|
40
|
+
- **Multi-Agent Collaboration**: Crew-based agents with supervisor orchestration and role-based specialization
|
|
41
|
+
- **Continuous Self-Improvement**: Autonomous fine-tuning, prompt optimization, and curriculum learning adjustment
|
|
42
|
+
|
|
43
|
+
## ๐ Project Structure
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
AGI/
|
|
47
|
+
โโโ core/ # Core AGI engine (centralized)
|
|
48
|
+
โ โโโ agi_engine.py
|
|
49
|
+
โ โโโ agi_executor.py # Graph-based executor
|
|
50
|
+
โ โโโ meta_controller.py
|
|
51
|
+
โโโ agents/ # Agent layer (NEW)
|
|
52
|
+
โ โโโ base_agent.py
|
|
53
|
+
โ โโโ agent_executor.py # Graph-based execution
|
|
54
|
+
โ โโโ crew.py # Multi-agent orchestration
|
|
55
|
+
โโโ memory/ # Specialized memory (NEW)
|
|
56
|
+
โ โโโ vector_store.py # Semantic memory with Chroma
|
|
57
|
+
โ โโโ graph_memory.py # Knowledge graph (Neo4j/NetworkX)
|
|
58
|
+
โ โโโ episodic_memory.py
|
|
59
|
+
โ โโโ working_memory.py
|
|
60
|
+
โ โโโ memory_consolidation.py
|
|
61
|
+
โโโ reasoning/ # Reasoning patterns (NEW)
|
|
62
|
+
โ โโโ react.py # ReAct pattern
|
|
63
|
+
โ โโโ cot.py # Chain-of-Thought
|
|
64
|
+
โ โโโ tot.py # Tree-of-Thoughts
|
|
65
|
+
โ โโโ got.py # Graph-of-Thoughts
|
|
66
|
+
โ โโโ self_reflection.py
|
|
67
|
+
โ โโโ meta_reasoning.py
|
|
68
|
+
โโโ tools/ # Tool management (NEW)
|
|
69
|
+
โ โโโ tool_registry.py
|
|
70
|
+
โ โโโ tool_executor.py
|
|
71
|
+
โ โโโ builtin_tools.py
|
|
72
|
+
โโโ algorithms/ # Research algorithms
|
|
73
|
+
โ โโโ core_algorithms.py
|
|
74
|
+
โ โโโ advanced_algorithms.py # โจ NEW: Attention, ODE, GAT, Optimizers
|
|
75
|
+
โ โโโ meta_learning.py
|
|
76
|
+
โ โโโ continual_learning.py
|
|
77
|
+
โโโ training/ # Training systems
|
|
78
|
+
โ โโโ training_systems.py
|
|
79
|
+
โ โโโ advanced_training.py # โจ NEW: Meta-learning, RL, Curriculum
|
|
80
|
+
โ โโโ self_improvement_loop.py
|
|
81
|
+
โ โโโ reinforcement_learning.py
|
|
82
|
+
โโโ infrastructure/ # Distributed & ops
|
|
83
|
+
โ โโโ distributed_training.py
|
|
84
|
+
โ โโโ advanced_infrastructure.py # โจ NEW: All-reduce, Health, FaultTol
|
|
85
|
+
โ โโโ observability.py # Tracing, logging (NEW)
|
|
86
|
+
โ โโโ config_manager.py # Hydra/Pydantic (NEW)
|
|
87
|
+
โโโ core/ # Core AGI engine
|
|
88
|
+
โ โโโ agi_engine.py
|
|
89
|
+
โ โโโ agi_executor.py
|
|
90
|
+
โ โโโ meta_controller.py
|
|
91
|
+
โ โโโ self_improvement_engine.py # โจ NEW: Autonomous improvement
|
|
92
|
+
โโโ evaluation/ # Evaluation & benchmarks
|
|
93
|
+
โ โโโ metrics.py
|
|
94
|
+
โ โโโ benchmark_runner.py # โจ NEW: 5-benchmark suite
|
|
95
|
+
โ โโโ benchmarks/ # Standard benchmarks (NEW)
|
|
96
|
+
โ โโโ agent_bench.py # Agent-specific eval (NEW)
|
|
97
|
+
โโโ examples/ # Comprehensive examples (EXPANDED)
|
|
98
|
+
โ โโโ quickstart.py
|
|
99
|
+
โ โโโ basic_agent.py
|
|
100
|
+
โ โโโ multi_agent_crew.py
|
|
101
|
+
โ โโโ self_improving_loop.py
|
|
102
|
+
โ โโโ memory_demo.py
|
|
103
|
+
โ โโโ reasoning_demo.py
|
|
104
|
+
โ โโโ notebooks/ # Jupyter notebooks (NEW)
|
|
105
|
+
โโโ tests/ # Testing suite (NEW)
|
|
106
|
+
โ โโโ test_agents.py
|
|
107
|
+
โ โโโ test_memory.py
|
|
108
|
+
โ โโโ test_reasoning.py
|
|
109
|
+
โ โโโ test_e2e.py
|
|
110
|
+
โโโ docs/ # Documentation
|
|
111
|
+
โ โโโ ARCHITECTURE.md # Updated architecture
|
|
112
|
+
โ โโโ API_REFERENCE.md
|
|
113
|
+
โ โโโ GETTING_STARTED.md
|
|
114
|
+
โ โโโ CONTRIBUTING.md
|
|
115
|
+
โ โโโ deepdive/ # Deep-dive guides (NEW)
|
|
116
|
+
โโโ configs/
|
|
117
|
+
โ โโโ config.yaml # Main config
|
|
118
|
+
โ โโโ agents/ # Agent configs (NEW)
|
|
119
|
+
โโโ pyproject.toml # Modern Python project (NEW)
|
|
120
|
+
โโโ requirements.txt
|
|
121
|
+
โโโ setup.py
|
|
122
|
+
โโโ LICENSE
|
|
123
|
+
โโโ .github/
|
|
124
|
+
โโโ workflows/ # CI/CD (NEW)
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## ๐ Quick Start (< 2 minutes)
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
# 1. Clone and setup
|
|
131
|
+
git clone https://github.com/tuanthescientist/AGI.git
|
|
132
|
+
cd AGI
|
|
133
|
+
pip install -e ".[dev]" # or: pip install -r requirements.txt
|
|
134
|
+
|
|
135
|
+
# 2. Run basic agent
|
|
136
|
+
python examples/quickstart.py
|
|
137
|
+
|
|
138
|
+
# 3. Run Jupyter notebook
|
|
139
|
+
jupyter notebook examples/notebooks/intro_to_agents.ipynb
|
|
140
|
+
|
|
141
|
+
# 4. Try multi-agent crew
|
|
142
|
+
python examples/multi_agent_crew.py
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## ๐ Architecture Overview
|
|
146
|
+
|
|
147
|
+
```
|
|
148
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
149
|
+
โ User / External Interface โ
|
|
150
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
151
|
+
โ
|
|
152
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
153
|
+
โ Agent Layer (Crew Orchestration) โ
|
|
154
|
+
โ - Supervisor Agent โ - Researcher โ - Planner โ - ... โ
|
|
155
|
+
โโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโ
|
|
156
|
+
โ โ
|
|
157
|
+
โโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโผโโโโโโโโโ
|
|
158
|
+
โ Graph-Based Agent Executor (State Machine) โ Tools โ
|
|
159
|
+
โ (LangGraph-inspired node/edge transitions) โ Registry โ
|
|
160
|
+
โโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโฌโโโโโโโ
|
|
161
|
+
โ โ
|
|
162
|
+
โโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโ
|
|
163
|
+
โ Reasoning Module Selector (ReAct / CoT / ToT / Meta-R) โ
|
|
164
|
+
โโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโ
|
|
165
|
+
โ โ
|
|
166
|
+
โโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโผโโโโโโโ
|
|
167
|
+
โ Hybrid Memory System โ Core Engineโ
|
|
168
|
+
โ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โ โ
|
|
169
|
+
โ โVector DB โ โGraph DB โ โ Episodic/Working โ โ Meta โ
|
|
170
|
+
โ โ(Semantic)โ โ(Knowledge)โ โ Memory โ โ Controllerโ
|
|
171
|
+
โ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โ Self-Improโ
|
|
172
|
+
โโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโฌโโโโโโโ
|
|
173
|
+
โ โ
|
|
174
|
+
โโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโผโโโโโโโโโโโ
|
|
175
|
+
โ Observability (Tracing, Logging, Metrics) โ LLM Backendsโ
|
|
176
|
+
โ (LangSmith, LangFuse, or custom) โ (OpenAI, โ
|
|
177
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโ
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### Visual Architecture (Mermaid Diagram)
|
|
181
|
+
|
|
182
|
+
```mermaid
|
|
183
|
+
graph TB
|
|
184
|
+
subgraph "Application Layer"
|
|
185
|
+
APP["User Application / Examples"]
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
subgraph "Agent & Crew Layer"
|
|
189
|
+
CREW["Crew Orchestration<br/>Sequential|Hierarchical|Parallel|Debate"]
|
|
190
|
+
AGENTS["Agent Archetypes<br/>Researcher|Planner|Executor|Critic|Monitor"]
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
subgraph "Reasoning & Execution"
|
|
194
|
+
SELECTOR["Reasoning Pattern Selector"]
|
|
195
|
+
PATTERNS["ReAct|CoT|ToT|GoT<br/>SelfReflection|MetaReasoning"]
|
|
196
|
+
EXECUTOR["Graph-Based Executor<br/>State Machine Pattern"]
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
subgraph "Memory System"
|
|
200
|
+
VECTOR["Vector Memory<br/>Semantic Storage"]
|
|
201
|
+
GRAPH["Graph Memory<br/>Knowledge Graphs"]
|
|
202
|
+
EPISODIC["Episodic Memory<br/>Experience Logging"]
|
|
203
|
+
PROCEDURAL["Procedural Memory<br/>Skills & Tools"]
|
|
204
|
+
WORKING["Working Memory<br/>Short-term Context"]
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
subgraph "Infrastructure"
|
|
208
|
+
TRACE["Observability<br/>Tracing & Monitoring"]
|
|
209
|
+
EVAL["Evaluation<br/>Benchmarks & Metrics"]
|
|
210
|
+
TOOLS["Tools Registry<br/>Plugin System"]
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
APP --> CREW
|
|
214
|
+
CREW --> AGENTS
|
|
215
|
+
AGENTS --> EXECUTOR
|
|
216
|
+
EXECUTOR --> SELECTOR
|
|
217
|
+
SELECTOR --> PATTERNS
|
|
218
|
+
PATTERNS --> VECTOR
|
|
219
|
+
PATTERNS --> GRAPH
|
|
220
|
+
EXECUTOR --> EPISODIC
|
|
221
|
+
EXECUTOR --> PROCEDURAL
|
|
222
|
+
EXECUTOR --> WORKING
|
|
223
|
+
EXECUTOR --> TRACE
|
|
224
|
+
AGENTS --> EVAL
|
|
225
|
+
EXECUTOR --> TOOLS
|
|
226
|
+
TRACE -.->|Export| EVAL
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
## โจ Key Features
|
|
230
|
+
|
|
231
|
+
### Architecture & Design
|
|
232
|
+
- โ
**Graph-Based Orchestration**: State machine-driven agent execution with explicit nodes, transitions, and conditional branches
|
|
233
|
+
- โ
**Modular Layer Design**: Low-level (algorithms), Mid-level (engines/memory), High-level (agents/crew)
|
|
234
|
+
- โ
**Strict Type Hints**: Pydantic v2 + dataclasses for all configs and states
|
|
235
|
+
- โ
**State Graph Pattern**: Inspired by LangGraph for complex multi-step workflows
|
|
236
|
+
|
|
237
|
+
### Memory & Learning
|
|
238
|
+
- โ
**Hybrid Memory System**:
|
|
239
|
+
- Vector stores (Chroma/Qdrant) for semantic memory
|
|
240
|
+
- Graph DB (Neo4j/NetworkX) for knowledge graphs
|
|
241
|
+
- Episodic memory with reflection
|
|
242
|
+
- Procedural memory for tool usage
|
|
243
|
+
- Working memory for short-term context
|
|
244
|
+
- โ
**Memory Consolidation**: Continual learning without catastrophic forgetting
|
|
245
|
+
- โ
**Multi-modal Support**: Text, embeddings, and structured data
|
|
246
|
+
|
|
247
|
+
### Reasoning & Agent Capabilities
|
|
248
|
+
- โ
**Multiple Reasoning Patterns**: ReAct, Chain-of-Thought, Tree-of-Thoughts, Graph-of-Thoughts, Self-Reflection, Meta-Reasoning
|
|
249
|
+
- โ
**Self-Improvement Loop**: Autonomous critique, uncertainty quantification, and policy optimization
|
|
250
|
+
- โ
**Advanced Tool Use**: Strict schema, error recovery, and usage tracking
|
|
251
|
+
- โ
**Multi-Agent Collaboration**: Crew patterns with roles, supervisor orchestration
|
|
252
|
+
|
|
253
|
+
### Production & Operations
|
|
254
|
+
- โ
**Full Observability**: LangSmith/LangFuse integration + custom tracing
|
|
255
|
+
- โ
**Comprehensive Evaluation**: MMLU, GSM8K, AgentBench, GAIA + custom metrics
|
|
256
|
+
- โ
**Config Management**: Hydr + Pydantic Settings with multi-environment support
|
|
257
|
+
- โ
**CI/CD Ready**: GitHub Actions, pytest, ruff + black + mypy
|
|
258
|
+
- โ
**Distributed Ready**: Ray or PyTorch Distributed for scaling
|
|
259
|
+
|
|
260
|
+
## ๏ฟฝ v0.2.0 Benchmark Results
|
|
261
|
+
|
|
262
|
+
Real benchmark evaluations with measurable results:
|
|
263
|
+
|
|
264
|
+
| Benchmark | Score | Details |
|
|
265
|
+
|-----------|-------|---------|
|
|
266
|
+
| **MMLU 5-shot** | 40% (2,800/7,000) | Knowledge reasoning - diverse topics |
|
|
267
|
+
| **GSM8K Math** | 40% (1,200/3,000) | Complex mathematical problem solving |
|
|
268
|
+
| **AgentBench** | 76% (38/50) | Agent tasks, 85% tool usage success |
|
|
269
|
+
| **Self-Awareness** | 77% avg | Calibration (78%), Planning (82%), Correction (71%) |
|
|
270
|
+
| **Code Generation** | 32% (52/164) | HumanEval-style code generation |
|
|
271
|
+
|
|
272
|
+
๐ **Evaluation Framework**: [benchmark_runner.py](evaluation/benchmark_runner.py) | [Full Report](RELEASE_NOTES_v0.2.0.md)
|
|
273
|
+
|
|
274
|
+
## ๐ฏ Advanced ML Components (v0.2.0+)
|
|
275
|
+
|
|
276
|
+
### Algorithms Module (`algorithms/advanced_algorithms.py`)
|
|
277
|
+
- Multi-Head Attention (8+ parallel heads)
|
|
278
|
+
- Positional Encoding (sinusoidal)
|
|
279
|
+
- GRU Cells (sequence processing)
|
|
280
|
+
- Graph Attention Networks (knowledge reasoning)
|
|
281
|
+
- Neural ODE Blocks (continuous transformations)
|
|
282
|
+
- Adam Optimizer (adaptive learning rates)
|
|
283
|
+
- Contrastive & Focal Loss functions
|
|
284
|
+
|
|
285
|
+
### Training Systems (`training/advanced_training.py`)
|
|
286
|
+
- Meta-Learning (MAML-style few-shot adaptation)
|
|
287
|
+
- Reinforcement Learning (policy gradients + baseline)
|
|
288
|
+
- Curriculum Learning (adaptive difficulty)
|
|
289
|
+
- Multi-Task Learning (shared representations)
|
|
290
|
+
- Adaptive Batch Normalization (stable training)
|
|
291
|
+
- Mixup Augmentation (data augmentation)
|
|
292
|
+
|
|
293
|
+
### Distributed Infrastructure (`infrastructure/advanced_infrastructure.py`)
|
|
294
|
+
- All-Reduce Operations (gradient synchronization)
|
|
295
|
+
- Gradient Compression (top-k sparsification)
|
|
296
|
+
- Resource Manager (CPU/GPU/memory allocation)
|
|
297
|
+
- Health Monitor (anomaly detection)
|
|
298
|
+
- Fault Tolerance (checkpoint recovery)
|
|
299
|
+
- Load Balancer (dynamic task distribution)
|
|
300
|
+
|
|
301
|
+
## ๐ Feature Matrix
|
|
302
|
+
|
|
303
|
+
| Feature | Status | Details |
|
|
304
|
+
|---------|--------|---------|
|
|
305
|
+
| **Graph-Based Agent Executor** | โ
v0.2 | State machine-driven execution |
|
|
306
|
+
| **Hybrid Memory System** | โ
v0.2 | Vector + Graph + Episodic |
|
|
307
|
+
| **Multi-Agent Crew** | โ
v0.2 | Supervisor orchestration |
|
|
308
|
+
| **Reasoning Patterns** | โ
v0.2 | ReAct, CoT, ToT, Meta-R |
|
|
309
|
+
| **Self-Improvement Loop Engine** | โ
v0.2 | 4-phase autonomous optimization |
|
|
310
|
+
| **Benchmarking Suite** | โ
v0.2 | MMLU, Math, AgentBench, Code |
|
|
311
|
+
| **Advanced ML Algorithms** | โ
v0.2 | Attention, position encoding, ODE |
|
|
312
|
+
| **Distributed Infrastructure** | โ
v0.2 | All-reduce, compression, load-balance |
|
|
313
|
+
| **Tool Use** | โ
v0.2 | Strict schema + error recovery |
|
|
314
|
+
| **Observability** | โ
v0.2 | LangSmith/LangFuse integration |
|
|
315
|
+
| **Vision-Language** | ๐ v0.3 | Multi-modal memory & reasoning |
|
|
316
|
+
| **Safety Guardrails** | ๐ v0.3 | NeMo Guardrails / Custom |
|
|
317
|
+
| **Uncertainty Quantification** | ๐ v0.3 | Confidence estimation |
|
|
318
|
+
|
|
319
|
+
## ๐ Comparison with Alternatives
|
|
320
|
+
|
|
321
|
+
| Aspect | AGI Framework | LangGraph | CrewAI | AutoGen |
|
|
322
|
+
|--------|---------------|-----------|--------|---------|
|
|
323
|
+
| **Graph Orchestration** | โ
Native | โ
Native | โ Sequential | โ Sequential |
|
|
324
|
+
| **Self-Awareness** | โ
Built-in | โ No | โ No | โ No |
|
|
325
|
+
| **Hybrid Memory** | โ
Vector+Graph | โ Minimal | โ No | โ No |
|
|
326
|
+
| **Meta-Learning** | โ
Yes | โ No | โ No | โ No |
|
|
327
|
+
| **Multi-Agent** | โ
Crew | โ ๏ธ Limited | โ
Yes | โ
Yes |
|
|
328
|
+
| **Reasoning Patterns** | โ
Full suite | โ
Basic | โ ๏ธ Limited | โ ๏ธ Limited |
|
|
329
|
+
| **Observability** | โ
Full | โ
Full | โ ๏ธ Limited | โ ๏ธ Limited |
|
|
330
|
+
| **Type Safety** | โ
Strict | โ
Good | โ ๏ธ Limited | โ No |
|
|
331
|
+
|
|
332
|
+
## ๐ Documentation
|
|
333
|
+
|
|
334
|
+
- **[GETTING_STARTED.md](docs/GETTING_STARTED.md)** - Installation and quick start
|
|
335
|
+
- **[ARCHITECTURE.md](docs/ARCHITECTURE.md)** - Detailed system architecture
|
|
336
|
+
- **[API_REFERENCE.md](docs/API_REFERENCE.md)** - Complete API documentation
|
|
337
|
+
- **[deepdive/](docs/deepdive/)** - Advanced topics (graphs, memory, reasoning)
|
|
338
|
+
- **[examples/](examples/)** - Runnable examples and Jupyter notebooks
|
|
339
|
+
|
|
340
|
+
## ๐ Examples
|
|
341
|
+
|
|
342
|
+
### Basic Agent
|
|
343
|
+
```python
|
|
344
|
+
from agents import Agent
|
|
345
|
+
from reasoning import ReAct
|
|
346
|
+
|
|
347
|
+
agent = Agent(
|
|
348
|
+
name="ResearchAgent",
|
|
349
|
+
reasoning_pattern=ReAct(),
|
|
350
|
+
tools=["search", "summarize"]
|
|
351
|
+
)
|
|
352
|
+
|
|
353
|
+
result = agent.run("What are recent advances in AGI?")
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
### Multi-Agent Crew
|
|
357
|
+
```python
|
|
358
|
+
from agents import Crew, Agent
|
|
359
|
+
|
|
360
|
+
crew = Crew(
|
|
361
|
+
supervisor_agent=Agent(name="Supervisor"),
|
|
362
|
+
agents=[
|
|
363
|
+
Agent(name="Researcher", role="research"),
|
|
364
|
+
Agent(name="Planner", role="planning"),
|
|
365
|
+
Agent(name="Executor", role="execution"),
|
|
366
|
+
],
|
|
367
|
+
communication_pattern="hierarchical"
|
|
368
|
+
)
|
|
369
|
+
|
|
370
|
+
result = crew.run("Solve a complex problem")
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
### Self-Improving Loop
|
|
374
|
+
```python
|
|
375
|
+
from core import AGISystem
|
|
376
|
+
|
|
377
|
+
agi = AGISystem(enable_self_improvement=True)
|
|
378
|
+
agi.train(data_source="./data", epochs=100)
|
|
379
|
+
|
|
380
|
+
# System automatically improves itself
|
|
381
|
+
introspection = agi.selfaware_introspection()
|
|
382
|
+
improvement_plan = agi.self_improvement.generate_improvement_plan()
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
See [examples/](examples/) for more.
|
|
386
|
+
|
|
387
|
+
## ๐๏ธ Installation & Setup
|
|
388
|
+
|
|
389
|
+
### Prerequisites
|
|
390
|
+
- Python 3.9+
|
|
391
|
+
- Poetry (recommended) or pip
|
|
392
|
+
|
|
393
|
+
### Installation
|
|
394
|
+
|
|
395
|
+
```bash
|
|
396
|
+
# Clone
|
|
397
|
+
git clone https://github.com/tuanthescientist/AGI.git
|
|
398
|
+
cd AGI
|
|
399
|
+
|
|
400
|
+
# With Poetry (Recommended for development)
|
|
401
|
+
poetry install
|
|
402
|
+
|
|
403
|
+
# With pip + dev dependencies
|
|
404
|
+
pip install -e ".[dev]"
|
|
405
|
+
|
|
406
|
+
# Minimal installation
|
|
407
|
+
pip install -e .
|
|
408
|
+
|
|
409
|
+
# With all optional dependencies
|
|
410
|
+
poetry install --with dev --extras all
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
### Development Setup
|
|
414
|
+
|
|
415
|
+
```bash
|
|
416
|
+
# Install development hooks
|
|
417
|
+
pre-commit install
|
|
418
|
+
|
|
419
|
+
# Format code
|
|
420
|
+
black agents/ memory/ reasoning/
|
|
421
|
+
|
|
422
|
+
# Lint
|
|
423
|
+
ruff check agents/ memory/ reasoning/
|
|
424
|
+
|
|
425
|
+
# Type check
|
|
426
|
+
mypy agents/ memory/ --strict
|
|
427
|
+
|
|
428
|
+
# Run tests
|
|
429
|
+
pytest tests/ -v --cov
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
### Supported LLM Backends
|
|
433
|
+
|
|
434
|
+
- OpenAI (GPT-4, GPT-3.5)
|
|
435
|
+
- Anthropic (Claude)
|
|
436
|
+
- Local models (Ollama, llama.cpp, vLLM)
|
|
437
|
+
- Hugging Face models
|
|
438
|
+
- Custom model providers
|
|
439
|
+
|
|
440
|
+
### Environment Variables
|
|
441
|
+
|
|
442
|
+
```bash
|
|
443
|
+
# LLM Configuration
|
|
444
|
+
export OPENAI_API_KEY="sk-..."
|
|
445
|
+
export ANTHROPIC_API_KEY="sk-ant-..."
|
|
446
|
+
|
|
447
|
+
# Optional: Vector DB
|
|
448
|
+
export CHROMA_DB_PATH="./data/chroma"
|
|
449
|
+
export NEO4J_URI="bolt://localhost:7687"
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
## ๐งช Running Tests
|
|
453
|
+
|
|
454
|
+
```bash
|
|
455
|
+
# All tests
|
|
456
|
+
pytest
|
|
457
|
+
|
|
458
|
+
# Specific module
|
|
459
|
+
pytest tests/test_agents.py -v
|
|
460
|
+
|
|
461
|
+
# With coverage
|
|
462
|
+
pytest --cov=core --cov=agents tests/
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
## ๐ Benchmarks
|
|
466
|
+
|
|
467
|
+
Built-in evaluation on:
|
|
468
|
+
- **General Knowledge**: MMLU (5-shot)
|
|
469
|
+
- **Math Reasoning**: GSM8K
|
|
470
|
+
- **Code**: HumanEval
|
|
471
|
+
- **Agent Tasks**: AgentBench, GAIA
|
|
472
|
+
- **Self-Awareness**: Custom metrics
|
|
473
|
+
|
|
474
|
+
Run benchmarks:
|
|
475
|
+
```bash
|
|
476
|
+
python -m evaluation.benchmarks --suite full
|
|
477
|
+
```
|
|
478
|
+
|
|
479
|
+
## ๐ CI/CD Pipeline
|
|
480
|
+
|
|
481
|
+
Automated quality assurance on every push:
|
|
482
|
+
|
|
483
|
+
- **Tests** ([lint.yml](.github/workflows/lint.yml)): Python 3.9-3.12 with pytest + coverage
|
|
484
|
+
- **Linting** ([tests.yml](.github/workflows/tests.yml)): Black, Ruff, MyPy type checking
|
|
485
|
+
- **Code Quality**: Pre-commit hooks for automatic formatting
|
|
486
|
+
|
|
487
|
+
### Local Quality Checks
|
|
488
|
+
|
|
489
|
+
```bash
|
|
490
|
+
# Install pre-commit hooks
|
|
491
|
+
pre-commit install
|
|
492
|
+
|
|
493
|
+
# Run all checks
|
|
494
|
+
pre-commit run --all-files
|
|
495
|
+
|
|
496
|
+
# Auto-format
|
|
497
|
+
black agents/ memory/ reasoning/ infrastructure/ evaluation/
|
|
498
|
+
isort agents/ memory/ reasoning/ infrastructure/ evaluation/
|
|
499
|
+
ruff check --fix agents/ memory/ reasoning/
|
|
500
|
+
```
|
|
501
|
+
|
|
502
|
+
## ๐ฆ Project Structure
|
|
503
|
+
|
|
504
|
+
```
|
|
505
|
+
AGI/
|
|
506
|
+
โโโ ๐ agents/ # Agent framework & crew orchestration
|
|
507
|
+
โโโ ๐ core/ # Core engine & graph executor
|
|
508
|
+
โโโ ๐ memory/ # Hybrid memory system (5 types)
|
|
509
|
+
โโโ ๐ reasoning/ # Reasoning patterns (6 types)
|
|
510
|
+
โโโ ๐ infrastructure/ # Observability, tracing, monitoring
|
|
511
|
+
โโโ ๐ evaluation/ # Benchmarking & metrics
|
|
512
|
+
โโโ ๐ examples/ # Quickstart & advanced patterns
|
|
513
|
+
โโโ ๐ tests/ # Integration & unit tests
|
|
514
|
+
โโโ ๐ algorithms/ # Research-grade ML algorithms
|
|
515
|
+
โโโ ๐ training/ # Training loops & optimization
|
|
516
|
+
โโโ ๐ docs/ # Documentation & architecture
|
|
517
|
+
โโโ ๐ .github/workflows/ # CI/CD pipelines (GitHub Actions)
|
|
518
|
+
โโโ ๐ pyproject.toml # Modern Python project config (Poetry)
|
|
519
|
+
โโโ ๐ .pre-commit-config.yaml # Pre-commit hooks
|
|
520
|
+
โโโ ๐ README.md # This file
|
|
521
|
+
```
|
|
522
|
+
|
|
523
|
+
### Key Files
|
|
524
|
+
|
|
525
|
+
- **[pyproject.toml](pyproject.toml)** - Project config, dependencies, tool settings
|
|
526
|
+
- **[.github/workflows/tests.yml](.github/workflows/tests.yml)** - Run tests on PR
|
|
527
|
+
- **[.github/workflows/lint.yml](.github/workflows/lint.yml)** - Code quality checks
|
|
528
|
+
- **[.pre-commit-config.yaml](.pre-commit-config.yaml)** - Local quality gates
|
|
529
|
+
- **[docs/deepdive/MODULE_REFERENCE.md](docs/deepdive/MODULE_REFERENCE.md)** - Complete API reference
|
|
530
|
+
- **[PROJECT_SUMMARY.md](PROJECT_SUMMARY.md)** - v0.2 upgrade details
|
|
531
|
+
|
|
532
|
+
## ๐ค Contributing
|
|
533
|
+
|
|
534
|
+
Contributions welcome! See [CONTRIBUTING.md](docs/CONTRIBUTING.md).
|
|
535
|
+
|
|
536
|
+
Key areas:
|
|
537
|
+
- [ ] Vision-language integration
|
|
538
|
+
- [ ] Extended reasoning patterns
|
|
539
|
+
- [ ] Specialized memory optimizations
|
|
540
|
+
- [ ] New agent archetypes
|
|
541
|
+
- [ ] Benchmark improvements
|
|
542
|
+
|
|
543
|
+
## ๐ Citation
|
|
544
|
+
|
|
545
|
+
If you use AGI Framework in research, please cite:
|
|
546
|
+
|
|
547
|
+
```bibtex
|
|
548
|
+
@software{tran2026agi,
|
|
549
|
+
title={AGI Framework: A Modular Framework for Self-Improving AGI Systems},
|
|
550
|
+
author={Tran, Tuan},
|
|
551
|
+
year={2026},
|
|
552
|
+
url={https://github.com/tuanthescientist/AGI}
|
|
553
|
+
}
|
|
554
|
+
```
|
|
555
|
+
|
|
556
|
+
## ๐ Support & Community
|
|
557
|
+
|
|
558
|
+
- **Issues**: [GitHub Issues](https://github.com/tuanthescientist/AGI/issues)
|
|
559
|
+
- **Discussions**: [GitHub Discussions](https://github.com/tuanthescientist/AGI/discussions)
|
|
560
|
+
- **Email**: tuanthescientist@gmail.com
|
|
561
|
+
|
|
562
|
+
## ๐ License
|
|
563
|
+
|
|
564
|
+
MIT License - see [LICENSE](LICENSE) for details
|