A beginner-friendly implementation of a Simple Reflex AI Agent using Python.
A Simple Reflex Agent makes decisions based only on the current input.
It does NOT:
- remember past inputs ❌
- learn from experience ❌
- plan future actions ❌
It simply follows predefined rules.
+------------------+
| User Input |
+--------+---------+
|
v
+------------------+
| Input Cleaner |
+--------+---------+
|
v
+------------------+
| Rule Matching |
+--------+---------+
|
v
+------------------+
| Output |
+------------------+
User → main.py → agent.py → processor.py → rules.py → Response
simple-reflex-agent/
│
├── agent/
│ ├── rules.py
│ ├── processor.py
│ └── agent.py
│
├── main.py
├── README.md
└── .gitignore
✅ Rule-based responses ✅ Input cleaning ✅ Keyword matching ✅ Modular architecture ✅ Beginner-friendly project structure
python -m venv venvvenv\Scripts\activatesource venv/bin/activatepython main.pyYou: hi
Agent: Hello!
You: how are you
Agent: I am fine!
You: bye
Agent: Goodbye!
- No memory
- No learning
- No reasoning
- Only reacts to current input
This project helps understand the foundation of all AI agents:
Input → Decision → Action
- Add memory
- Add planning
- Add learning
- Add reasoning
- Rule-based systems
- Input processing
- Decision making
- Modular architecture
- Git & GitHub workflow