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/
-
Run the setup script
./setup_env.sh
This creates a Python virtual environment in
.venv
, installs the requirements and generates an.env.example
file. Copy.env.example
to.env
and fill in your API keys. -
(Manual setup) If you prefer to do things manually, create and activate the virtual environment and install dependencies yourself:
python3.11 -m venv .venv source .venv/bin/activate uv pip install -r requirements.txt
-
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