How naveen457/rl-based-adaptive-mas works
AMAS accepts tasks through a CLI or HTTP API, profiles task context, and uses an active tabular Q-learning controller to adapt an agent architecture before execution. The runtime bridges the adapted architecture to a workflow, runs specialist agents and tools, and returns a finalized answer; evaluation and a separate offline neural-policy research branch support the system. Edges are limited to README workflow statements and source-index references; unsampled implementations are represented only where the README documents the capability.
Main entry points: orchestrator.py Runtime orchestrator · llm_execution.py LLM executor · manager.py Architecture manager · meta_task.py Task profiler
Components 25
Adaptive architecture
- Task profiler
app/rl/meta_task.py - State encoder
app/rl/state.py - Tabular Q-learning
app/rl/q_learning.py - Architecture actions
app/architecture/actions.py - Architecture manager
app/architecture/manager.py - Architecture model
app/architecture/models.py
Agent execution
- Workflow adapter
app/graph/adaptive_integration.py - Dynamic graph builder
app/graph/dynamic_builder.py - Runtime orchestrator
app/runtime/orchestrator.py - Planner
app/agents/planner.py - Agent registry
app/agents/registry.py - Specialist agents
app/agents - LLM executor
app/runtime/llm_execution.py - Tool executor
app/agents/tool_executor.py - External tools
app/tools - Finalizer
app/agents/finalizer.py
State and evaluation
- Thread memory
app/memory/store.py - MongoDB
app/memory/mongo_client.py - Task evaluation
app/evaluation/evaluator.py - Reward calculation
app/evaluation/reward.py
Offline policy research
- Neural meta-policy
app/rl/meta_neural_trainer.py - Meta-policy evaluation
app/rl/meta_evaluation.py
Other components
- User
Connections 25
- User → CLI: submits task
- User → HTTP API: submits task
- CLI → Task profiler: profiles task
app/main.py - HTTP API → Task profiler: profiles task
app/server.py - Task profiler → State encoder: provides context
app/rl/state.py - State encoder → Tabular Q-learning: encodes state
app/rl/q_learning.py - Tabular Q-learning → Architecture actions: selects mutation
app/rl/q_learning.py - Architecture actions → Architecture manager: describes mutation
app/architecture/manager.py - Architecture manager → Architecture model: validates architecture
app/architecture/manager.py - Architecture manager → Workflow adapter: supplies architecture
app/graph/adaptive_integration.py - Workflow adapter → Dynamic graph builder: configures workflow
app/graph/adaptive_integration.py - Runtime orchestrator → Planner: runs planning
app/runtime/orchestrator.py - Runtime orchestrator → Workflow adapter: adapts architecture
app/runtime/orchestrator.py - Runtime orchestrator → Dynamic graph builder: invokes graph
app/runtime/orchestrator.py - Runtime orchestrator → LLM executor: executes agents
app/runtime/orchestrator.py - Planner → Agent registry: reads capabilities
app/agents/planner.py - LLM executor → Specialist agents: runs specialists
app/runtime/llm_execution.py - LLM executor → Tool executor: runs tool calls
app/runtime/llm_execution.py - Tool executor → External tools: dispatches tools
- LLM executor → Finalizer: finalizes response
app/runtime/llm_execution.py - Runtime orchestrator → Thread memory: stores messages
app/runtime/orchestrator.py - Thread memory → MongoDB: uses connection
app/memory/store.py - Task evaluation → Architecture model: evaluates structure
app/evaluation/evaluator.py - Reward calculation → Task evaluation: scores performance
app/evaluation/reward.py - Neural meta-policy → Meta-policy evaluation: evaluated by