@QingQ77: Build a pure Python self-evolving AI framework with 64 modules each managing its own tasks. The AI can remember, learn, modify code, and reflect on its own, without installing additional libraries. https://github.com/primaxlab/SelfEvolvingAI… 64 modules, from mem…
Summary
This is a pure Python self-evolving AI framework with 64 modules covering features like memory, knowledge graphs, and federated learning, and it runs without additional libraries.
View Cached Full Text
Cached at: 05/29/26, 02:11 PM
Build a pure Python self-evolving AI framework with 64 independent modules. The AI can memorize, learn, modify its own code, and reflect — all without installing any extra libraries. https://github.com/primaxlab/SelfEvolvingAI… 64 modules covering memory, knowledge graphs, federated learning, plugin systems — all in Python.
primaxlab/SelfEvolvingAI
Source: https://github.com/primaxlab/SelfEvolvingAI
🧬 SelfEvolvingAI - Self-Evolving AI System
A complete self-evolving AI system framework integrating 64 modules
Complete List of 64 Modules
Core Modules (1-7)
| # | Module | File | Function |
|---|---|---|---|
| 1 | Memory System | memory.py | Short-term/long-term/episodic memory, user profile, memory consolidation, forgetting curve |
| 2 | Tool Extender | tool_extender.py | Dynamic tool registration, tool learning, tool orchestration, performance tracking |
| 3 | Code Self-Improver | self_improver.py | AST code analysis, defect detection, automatic fix, version management |
| 4 | Metacognition | metacognition.py | Capability assessment, confidence calculation, knowledge gap detection, help-seeking decisions |
| 5 | Knowledge Graph | knowledge_graph.py | Entity recognition, relation extraction, graph storage, semantic reasoning |
| 6 | Goal Planning | goal_planning.py | Goal decomposition, DAG scheduling, progress tracking, plan adjustment |
| 7 | Reflection Loop | reflection.py | Experience extraction, pattern recognition, strategy optimization, knowledge update |
Extension 1 (8-17)
| # | Module | File | Function |
|---|---|---|---|
| 8 | Active Exploration | active_exploration.py | Knowledge gap discovery, exploration strategy, self-learning mechanism |
| 9 | Collaboration System | collaboration.py | Self-assessment, collaborator discovery, task assignment |
| 10 | Emotional Intelligence | emotional_intelligence.py | Emotion recognition, interpretation, response generation, emotional memory |
| 11 | Causal Reasoning | causal_reasoning.py | Causal identification, graph construction, counterfactual reasoning |
| 12 | Transfer Learning | transfer_learning.py | Domain similarity, knowledge abstraction, cross-domain transfer |
| 13 | Continual Learning | continual_learning.py | Forgetting prevention, knowledge consolidation, interference detection |
| 14 | Knowledge Distillation | knowledge_distillation.py | Pattern extraction, rule generation, knowledge compression |
| 15 | Creative Thinking | creative_thinking.py | Divergent thinking, analogical reasoning, combinatorial innovation |
| 16 | Multimodal | multimodal.py | Text/image/audio processing, cross-modal association, fusion |
| 17 | Adversarial Robustness | adversarial_robustness.py | Attack detection, defense execution, anomaly analysis, security audit |
Extension 2 (18-32)
| # | Module | File | Function |
|---|---|---|---|
| 18 | Meta Learning | meta_learning.py | Learning strategy analysis, rate adaptation, outcome prediction |
| 19 | Reinforcement Learning | reinforcement_learning.py | Q-learning, state encoding, reward computation |
| 20 | Attention | attention.py | Importance assessment, focus management, distraction filtering |
| 21 | Context Awareness | context_awareness.py | Time/user/task context, adaptation suggestions |
| 22 | Self-Healing System | self_healing.py | Fault detection/diagnosis, automatic repair, health monitoring |
| 23 | Knowledge Evolution | knowledge_evolution.py | Version management, conflict detection, knowledge merging |
| 24 | Predictive Learning | predictive_learning.py | Trend/behavior/demand prediction |
| 25 | Distributed Collaboration | distributed_collaboration.py | Instance management, task assignment, result aggregation, load balancing |
| 26 | Adaptive Architecture | adaptive_architecture.py | Architecture monitoring, bottleneck identification, dynamic scaling |
| 27 | Neuro-Symbolic | neuro_symbolic.py | Neural feature extraction, symbolic reasoning, hybrid decision-making |
| 28 | Self-Supervised | self_supervised.py | Auto-labeling, contrastive learning, prediction tasks |
| 29 | Memory Palace | memory_palace.py | Spatial memory organization, association management, memory paths |
| 30 | Decision Patterns | decision_patterns.py | Decision recording, pattern recognition, strategy optimization |
| 31 | Adaptive Learning Rate | adaptive_learning_rate.py | Learning rate scheduling, convergence detection |
| 32 | Federated Learning | federated_learning.py | Local training, model aggregation (FedAvg), privacy preservation |
Extension 3 (33-44)
| # | Module | File | Function |
|---|---|---|---|
| 33 | Prompt Engineering | prompt_engineering.py | Prompt generation, optimization, A/B testing, evaluation |
| 34 | Task Orchestration | task_orchestration.py | DAG task orchestration, dependency resolution, parallel scheduling |
| 35 | Code Generation | code_generation.py | Code templates, optimization, quality assessment, refactoring suggestions |
| 36 | Test Automation | test_automation.py | Test generation, execution, coverage analysis |
| 37 | Auto Documentation | auto_documentation.py | AST code parsing, API doc generation, changelog |
| 38 | Performance Optimization | performance_optimization.py | Performance analysis, bottleneck detection, auto-optimization, anomaly detection |
| 39 | Configuration Management | configuration_management.py | Config storage, version control, hot reload, environment management |
| 40 | Log Analysis | log_analysis.py | Log collection, pattern recognition, anomaly detection, trend analysis |
| 41 | Monitoring & Alerting | monitoring_alerting.py | Metric collection, threshold monitoring, alert triggering, health checks |
| 42 | Backup & Recovery | backup_recovery.py | Full/incremental backup, recovery management, version rollback |
| 43 | API Gateway | api_gateway.py | Route management, rate limiting, authentication, load balancing |
| 44 | Message Queue | message_queue.py | Message production/consumption, priority queue, dead letter handling |
Extension 4 (45-54)
| # | Module | File | Function |
|---|---|---|---|
| 45 | Cache Manager | cache_manager.py | LRU/LFU cache, tag invalidation, cache penetration protection |
| 46 | Scheduler | scheduler.py | Cron scheduling, interval scheduling, delayed execution, callback management |
| 47 | Vector Store | vector_store.py | Vector storage, cosine/Euclidean/dot product similarity search |
| 48 | Session Manager | session_manager.py | Session create/resume, state persistence, timeout management |
| 49 | Natural Language Understanding | nlu_engine.py | Intent recognition, entity extraction, slot filling |
| 50 | Recommendation Engine | recommendation.py | Collaborative filtering, content-based recommendation, hybrid recommendation |
| 51 | Data Pipeline | data_pipeline.py | ETL pipeline, data cleaning, data transformation |
| 52 | Feature Engineering | feature_engineering.py | Feature extraction, selection, transformation, correlation analysis |
| 53 | Workflow Engine | workflow_engine.py | Visual workflow, conditional branching, loops |
| 54 | Notification Center | notification_center.py | Multi-channel notifications, subscriptions, templates, broadcasts |
Extension 5 (55-64) 🆕
| # | Module | File | Function |
|---|---|---|---|
| 55 | Encryption Service | encryption_service.py | Hashing, HMAC signing, encryption/decryption, key management |
| 56 | Full-Text Search | search_engine.py | Inverted index, BM25 ranking, fuzzy search, search suggestions |
| 57 | Rate Limiter | rate_limiter.py | Token bucket, sliding window, fixed window, rate limiting statistics |
| 58 | Plugin System | plugin_system.py | Plugin register/load/unload, hooks, lifecycle management |
| 59 | Stream Processor | stream_processor.py | Stream creation, event sending, window aggregation, consumers |
| 60 | Distributed Lock | distributed_lock.py | Mutex lock, reentrant lock, optimistic lock, lock renewal |
| 61 | Data Sync | data_sync.py | Change tracking, incremental sync, conflict resolution, version management |
| 62 | Model Serving | model_serving.py | Model registration, loading, deployment, inference, A/B testing |
| 63 | Web Server | web_server.py | Routing, middleware, static files, request handling |
| 64 | Internationalization | i18n.py | Multi-language translation, language detection, number/date formatting |
Quick Start
cd SelfEvolvingAI
python main.py # Interactive mode
python main.py --status # View system status
python main.py --evolve # Trigger evolution
python main.py --modules # View 64 modules status
python main.py --report # Generate full report
Code Example
from core.evolution_loop import SelfEvolvingAI
ai = SelfEvolvingAI("./my_project")
result = ai.process("How to read a file in Python?")
print(f"Modules involved: {len(result['modules_used'])}")
evolution = ai.evolve("manual")
print(f"Evolution generation: {ai.state.generation}")
Evolution Loop (64 Modules Involved)
Perception → Context Awareness + Multimodal + Attention + NLU + Emotion
↓
Memory → Memory System + Memory Palace + Knowledge Graph + Vector Store
↓
Thinking → Metacognition + Causal Reasoning + Neuro-Symbolic + Creative Thinking + Recommendation
↓
Action → Goal Planning + Task Orchestration + Tool Invocation + Code Generation + Workflow
↓
Reflection → Reflection Loop + Decision Patterns + Predictive Learning + Knowledge Distillation
↓
Evolution → Code Self-Improver + Knowledge Evolution + Self-Healing + Adaptive Architecture
↓
Infrastructure → Cache + Scheduler + Session + Pipeline + Feature + Notification + Monitoring
↓
Security Extensions → Encryption + Rate Limiter + Distributed Lock + Full-Text Search + Plugin + Streaming
Design Principles
- Zero Dependencies — Pure Python implementation, no external libraries required
- Modular — Each module is independent and can be used individually
- Safety First — All modifications must be reversible
- Incremental — Small improvements, no big refactors
- Quantifiable — All evaluations supported by numerical metrics
License
MIT License
Similar Articles
@QingQ77: 开源的"代码即动作"科研智能体,用持久化内核运行真正的 Python/R 代码而不是固定工具表,让研究者靠便宜模型(豆包 ¥9.9/月)复现 Claude Science 级别的科研自动化。 https://github.com/PKU-…
开源的科研智能体 OpenAI4S,通过持久化内核运行真正的 Python/R 代码,结合 JSON 工具编排,让研究者可以用极低成本(豆包 ¥9.9/月)复现 Claude Science 级别的科研自动化。
@zhouluobo: A practical AI toolchain, I think it should cover at least 10 components. 1. Entry: Hermes Agent 2. Code Execution: Claude Code, Codex, Gemini CLI 3. Long-term Memory: Obsidian, QMD, SQLite 4. …
Introduces a complete AI toolchain covering 10 components: entry, code execution, memory, task scheduling, networking, deployment, knowledge base, web operations, multimedia production, and information distribution, with specific tool recommendations for each.
@QingQ77: Loops provides 100 carefully curated AI-driven automation loop templates, covering software development, data science, content creation, product operations, learning management, and more. https://github.com/jwangkun/loops Let the AI assistant repeatedly "do → check → fix → do again"…
Loops is an open-source project containing 100 AI-driven automation loop templates, covering areas such as software development, data science, content creation, and more. It supports AI coding assistants like Claude Code, Cursor, and Trae, enabling autonomous task completion through the closed-loop pattern of "Execute → Check → Fix → Repeat".
@cevenif: Using Claude Code or Codex for development, but feel like AI is running wild? This course might be the missing piece you need. There's an open-source course on GitHub called Learn Harness Engineering, which teaches you to establish a controllable workflow framework for AI coding assistants, centered around five core mechanisms...
GitHub open-source course Learn Harness Engineering teaches you to build a controllable workflow framework for AI coding assistants (e.g., Claude Code, Codex). It includes 12 theory lessons and 6 hands-on projects, covering core mechanisms: instruction, state, validation, scope, and session.
@GitHub_Daily: Many tutorials teach AI Agent development by jumping straight into frameworks — you install it and it runs, but you don't really understand what's going on underneath. ai-agents-from-scratch takes the opposite approach, starting from the most basic model call and gradually building up core patterns like tool calling, memory, and ReAct loops. It uses local models throughout…
GitHub_Daily recommends an open-source project called ai-agents-from-scratch. It starts from zero and uses local models to gradually implement core patterns such as tool calling, memory, and ReAct loops, helping developers understand the underlying principles of AI Agents without directly using frameworks.