Memory Management
SQLsaber allows you to provide persistent context about your database, business rules, and preferences to the model via its memory system.
This helps the LLMs generate better queries and more relevant insights.
Memory entries are database-specific, persistent and flexible. They are available across all conversations and automatically included.
Adding Memory
Section titled “Adding Memory”Via Command Line
Section titled “Via Command Line”Add memory entries using the CLI:
# Add memory for default databasesaber memory add "Customer churn is calculated as customers lost / total customers at start of period"
# Add memory for specific databasesaber memory add -d prod-db "Revenue is recognized when orders are shipped, not when placed"
# Add multiple types of contextsaber memory add "Always format dates as YYYY-MM-DD for reports"saber memory add "Fiscal year runs from April 1 to March 31"
In Interactive Sessions
Section titled “In Interactive Sessions”To add memory directly during conversations, start the message with #
sign.
> # Our conversion rate is calculated as purchases / unique visitors
✓ Memory added
List All Memories
Section titled “List All Memories”View all memory entries for your default database:
saber memory list
For a specific database:
saber memory list -d prod-db
Remove Memory
Section titled “Remove Memory”Delete specific memory entries:
# Remove by memory ID (from list output)saber memory remove a1b2c3d4-e5f6-7890-abcd-ef1234567890
Clear All Memory
Section titled “Clear All Memory”Remove all memory entries for a database:
# Clear default database memorysaber memory clear
# Clear specific database memorysaber memory clear -d prod-db
# Confirmation will be requested for safety
Be Specific and Clear
Section titled “Be Specific and Clear”Good memory entries:
saber memory add "Exclude test accounts (user_id < 1000) from all customer metrics as they skew results"saber memory add "Use shipped_date not order_date for revenue recognition per accounting rules"
Avoid vague entries:
# Too vaguesaber memory add "Calculate things properly"saber memory add "Use the right formula"
Getting Help
Section titled “Getting Help”Check memory commands and options:
saber memory --helpsaber memory add --helpsaber memory list --help
What’s Next?
Section titled “What’s Next?”With memory configured:
- Learn advanced querying techniques
- Manage conversation threads with consistent context
- Explore different models and see how they use memory
- Review the command reference for all memory options