This project demonstrates how to integrate a Jadex BDI agent with a Python-based PyTorch model to enable intelligent decision-making in agent-based systems.
The agent extracts feature values, sends them to a Python ML model via REST API, and uses the returned decision to act within its environment. This enables hybrid AI combining symbolic (BDI) and sub-symbolic (ML) methods.
├── jadex-bdi-agent/ # Java-based BDI agent (Jadex)
│ └── DecisionAgent.java # Main agent with PyTorch integration
├── python-ml-server/ # Python REST API with PyTorch model
│ └── app.py # Flask server that serves model predictions
└── README.md # Project documentation
- Java 11+
- Jadex Platform (v3.0+)
- Python 3.8+
- Flask (
pip install flask) - PyTorch (
pip install torch)
###⚙️ Run Instructions
Navigate to python-ml-server/ and run:
python app.pyThis will start a server on http://localhost:5000/predict that accepts JSON input like:
{
"features": [0.1, 0.4, 0.6, 0.8]
}And responds with a single integer decision, e.g. 1.
Use Jadex or your Java IDE to run the agent defined in DecisionAgent.java. The agent will:
- Initialize with default feature values
- Trigger a goal
- Call the Python model
- Print the result
Request sent from agent:
{
"features": [0.1, 0.4, 0.6, 0.8]
}Response from Python server:
1- Add feature extraction from environment
- Multiple agents with distributed decision making
- Secure communication between agent and server (e.g., token auth)
- Use FastAPI instead of Flask for async support
- Jadex BDI Framework: https://www.activecomponents.org
- PyTorch: https://pytorch.org
- Flask: https://flask.palletsprojects.com