A modular, autonomous Agentic AI system that plans, executes, critiques, remembers, and adapts, inspired by real-world agent architectures used in modern AI research and engineering teams.
This project is built entirely using free and open-source tools, with local LLM integration, and follows clean system-level design principles rather than chatbot-style scripting.
This system demonstrates how intelligent agents can be decomposed into clearly defined roles and coordinated through a deterministic control loop. The architecture emphasizes explainability, safety, and observability over black-box behavior.
- Autonomous agent loop with explicit control flow
- Clear separation of reasoning, execution, and evaluation
- Safe tool execution with bounded retries
- Persistent short-term and long-term memory
- Explicit failure handling and recovery
- Full observability via execution traces
- Local LLM integration using Ollama
- No paid APIs and no cloud dependency
USER GOAL
↓
Planner Agent → Executor Agent → Critic Agent
↑ ↓
└──────────── Memory Layer ──────┘
↓
Agent Loop Controller
Each component has a single responsibility and is coordinated by a central controller.
- Decomposes high-level goals into ordered, executable steps
- Uses local LLM reasoning when available
- Falls back to deterministic rule-based planning
- Does not execute tools
- Executes one step at a time using whitelisted tools
- Does not judge correctness
- Produces structured execution results
- Evaluates execution outcomes
- Decides whether to accept, retry, or abort a step
- Supports optional LLM-based evaluation
- Ensures correctness and safety
- Python execution tool
- Shell command tool
- File read/write tool
- Central tool registry enforces safety boundaries
- Short-term memory for current task context
- Long-term JSON-based persistent memory
- Full decision history preserved across runs
- Orchestrates all agents
- Enforces retry limits and stopping conditions
- Handles failure classification
- Ensures deterministic execution
- Human-readable execution traces
- Complete reasoning, actions, and results captured
- Suitable for debugging, demos, and interviews
This project integrates local large language models using Ollama, enabling:
- Offline inference
- No usage cost
- No external data transmission
- Safe fallback to deterministic logic
Supported models include LLaMA 3, Mistral, Phi, and Gemma.
LLM usage is optional and does not affect system stability.
- Python 3.10 or higher
- Pydantic for data validation
- Rich for structured logging
- Ollama for local LLM inference
- JSON-based persistence
- Modular, production-style architecture
All technologies used are free and open source.
agentic_ai_os/
├── agents/
│ ├── planner.py
│ ├── executor.py
│ └── critic.py
├── controller/
│ └── loop_controller.py
├── core/
│ ├── schemas.py
│ ├── execution.py
│ ├── failure.py
│ ├── trace.py
│ └── llm.py
├── tools/
│ ├── base.py
│ ├── python_tool.py
│ ├── shell_tool.py
│ └── file_tool.py
├── memory/
│ ├── short_term.py
│ ├── long_term.py
│ └── manager.py
├── demos/
│ ├── demo_research.py
│ ├── demo_coding.py
│ └── demo_planning.py
└── main.py
pip install -r requirements.txtollama pull llama3
ollama servepython -m agentic_ai_os.mainpython -m agentic_ai_os.demos.demo_researchDemonstrates structured reasoning without execution.
python -m agentic_ai_os.demos.demo_codingDemonstrates full agent loop with planning, execution, critique, retries, and memory.
python -m agentic_ai_os.demos.demo_planningDemonstrates general-purpose planning for non-coding tasks.
Failures are explicitly classified and handled:
- No silent failures
- Clear abort reasons
- Bounded retries
- Full execution traces preserved
- Rule-based execution logic by design
- No dynamic replanning
- No vector-based semantic memory
These choices prioritize explainability and reliability.