A Python implementation of a Model-Based AI Agent with memory and state management.
A Model-Based Agent can:
✅ remember past information ✅ use memory to make decisions ✅ maintain internal state
Unlike a Simple Reflex Agent, this agent does not rely only on current input.
+------------------+
| User Input |
+--------+---------+
|
v
+------------------+
| Input Cleaner |
+--------+---------+
|
v
+------------------+
| Information |
| Extraction |
+--------+---------+
|
v
+------------------+
| Memory |
+--------+---------+
|
v
+------------------+
| Decision Engine |
+--------+---------+
|
v
+------------------+
| Output |
+------------------+
User → main.py → agent.py → processor.py → memory.py → Response
model-based-agent/
│
├── agent/
│ ├── memory.py
│ ├── processor.py
│ ├── rules.py
│ └── agent.py
│
├── main.py
├── README.md
└── .gitignore
✅ Stores user information ✅ Retrieves stored memory ✅ Handles multiple memory types ✅ Modular architecture ✅ Stateful behavior
The agent can remember:
- user name
- location
- future expandable memory fields
python -m venv venvvenv\Scripts\activatesource venv/bin/activatepython main.pyYou: my name is Ravi
Agent: Got it! I will remember your name is Ravi
You: what is my name
Agent: Your name is Ravi
You: i live in Chennai
Agent: Got it! I will remember your location is Chennai
You: where do i live
Agent: You live in Chennai
- Stateful agents
- Memory systems
- Information extraction
- Internal state management
- Modular AI architecture
- No learning
- No planning
- No reasoning
- Only remembers predefined information
- Persistent memory
- Database integration
- Planning systems
- Multi-step reasoning
- Learning mechanisms
This project demonstrates:
Input + Memory → Decision → Action
| Feature | Simple Reflex | Model-Based |
|---|---|---|
| Memory | ❌ | ✅ |
| State | ❌ | ✅ |
| Context Awareness | ❌ | ✅ |
| Rule-Based | ✅ | ✅ |