This project features a DSPy-based agent that can run commands and interact with users. It uses OpenRouter models for processing requests.
-
Ensure you are in the project root directory:
/home/tom/git/agent/
-
Create and activate a Python virtual environment (if you haven't already for this project):
python3.11 -m venv .venv source .venv/bin/activate
-
Install or update dependencies: If
requirements.txt
is new or you've just created it:uv pip install -r requirements.txt
If you are adding to an existing
requirements.txt
, ensure the new packages are installed. -
Set up OpenRouter API key:
- Create a free account at OpenRouter
- Add your API key to environment variables:
echo "export OPENROUTER_API_KEY='your_api_key'" >> ~/.bashrc source ~/.bashrc
-
Run the SimpleDSPy agent:
python agent_simpledspy.py
The agent's performance depends on quality training data stored in .simpledspy/modules/
. To improve results:
-
Review logged interactions:
less .simpledspy/modules/*/logged.jsonl
-
Add good samples to training data: Copy well-performing examples from
logged.jsonl
to correspondingtraining.jsonl
files -
Correct problematic samples: Edit
training.jsonl
to fix incorrect responses -
Add new training examples: Create new entries in
training.jsonl
for desired behaviors
- The main agent script is
agent_simpledspy.py
- Training data is stored in
.simpledspy/modules/
- Use
--lm
flag to switch models:flash
,r1
, ordv3
python agent_simpledspy.py --lm r1