Overview
System prompts define agent behavior, personality, and operational guidelines. Junkie uses a dual-source approach: prompts are fetched from Phoenix (production) with fallback to local files.Prompt Architecture
Junkie has two levels of prompts:- Team Leader Prompt: Main personality and orchestration logic (from Phoenix or
system_prompt.md) - Agent-Specific Prompts: Specialized instructions for each agent (defined in code)
Phoenix Integration
Fetching from Phoenix
Phoenix Client Setup
Prompt Identifier and Tag
- Modify in Phoenix UI
- Tag as “production”
- Changes take effect on next team initialization
Local Fallback System
Fallback Function
Caching Strategy
- In-memory cache: Prompt loaded once per process
- Performance: Avoids repeated file I/O
- Updates: Require process restart to reload from file
Team Leader Prompt Structure
The main prompt (system_prompt.md) includes:
1. Identity and Context
2. Discord-Specific Rules
3. Temporal Awareness
4. Delegation Hierarchy
5. Accuracy and Verification
6. Personality Guidelines
7. Tone and Style
8. Prohibited Phrases
Agent-Specific Prompts
Each agent has specialized instructions:Code Agent Instructions
Context Q&A Agent Instructions
Groq Compound Agent Instructions
Updating Prompts
Update Phoenix Prompt (Recommended)
-
Login to Phoenix
-
Navigate to Prompts
- Find prompt identifier:
herocomp
- Find prompt identifier:
-
Edit and Save
- Make changes
- Tag as
production
-
Verify
Update Local Fallback
-
Edit file:
-
Restart process:
-
Verify:
Update Agent Instructions
Edit directly inagent/agent_factory.py:
Prompt Best Practices
1. Clear Hierarchy
2. Critical Instructions
3. Examples
4. Tool Usage Guidelines
5. Behavioral Rules
Prompt Testing
Test Prompt Fetch
Test Fallback
Test Agent Instructions
Configuration
Environment variables:Prompt Versioning
Phoenix supports version tags:agent/agent_factory.py:131.