Saved Sonar prompts #35
Labels
No labels
bug
documentation
duplicate
enhancement
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
gertjan/bodega#35
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Overview
Allow users to save, name, and reuse Sonar prompts so they don't have to retype them on every call.
Proposed implementation
Storage
user_promptsuser_id,name(encrypted with user DEK — same pattern as watchlists/portfolios),prompt_text(plaintext),prompt_type("augmented" | "raw"),created_at,updated_atAPI endpoints
GET /prompts— list saved prompts for the current userPOST /prompts— create a new saved promptGET /prompts/{pid}— get a single promptPUT /prompts/{pid}— update a saved promptDELETE /prompts/{pid}— delete a saved promptCLI commands
bodega prompts listbodega prompts create --name "my macro scan" --type raw --text "What are the biggest macro risks this week?"bodega prompts get <pid>bodega prompts update <pid> --text "..."bodega prompts delete <pid>Integration with existing endpoints
Once implemented,
/facts/sonar/augmentedand/facts/sonar/rawshould accept an optionalprompt_idfield in the request body. When provided, the saved prompt text is used instead of (or appended to) thecontext/promptfield.Related
src/database/repositories/watchlists.pymentioned in commit
c36fe91f21mentioned in commit
80d89ea5d1Implemented in commit
80d89ea. Full feature implementation:✅ Storage: MongoDB collection
user_promptswith encrypted names✅ Private CRUD: All endpoints implemented (/prompts, /prompts/{pid}, etc.)
✅ Public sharing: Mark prompts public with plaintext name copy (universe pattern)
✅ Sonar integration: POST /facts/sonar/{augmented,raw} now accept prompt_id
✅ CLI commands: bodega prompts list|create|get|update|delete|share|public-list|public-show
✅ Sonar CLI: Updated with --prompt-id option for both augmented and raw queries
Version bumped to 0.17.9. See CHANGELOG and commits for full details.