Skip to content

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.

Add memory entries using the CLI:

Terminal window
# Add memory for default database
saber memory add "Customer churn is calculated as customers lost / total customers at start of period"
# Add memory for specific database
saber memory add -d prod-db "Revenue is recognized when orders are shipped, not when placed"
# Add multiple types of context
saber memory add "Always format dates as YYYY-MM-DD for reports"
saber memory add "Fiscal year runs from April 1 to March 31"

To add memory directly during conversations, start the message with # sign.

> # Our conversion rate is calculated as purchases / unique visitors
✓ Memory added

View all memory entries for your default database:

Terminal window
saber memory list

For a specific database:

Terminal window
saber memory list -d prod-db

Delete specific memory entries:

Terminal window
# Remove by memory ID (from list output)
saber memory remove a1b2c3d4-e5f6-7890-abcd-ef1234567890

Remove all memory entries for a database:

Terminal window
# Clear default database memory
saber memory clear
# Clear specific database memory
saber memory clear -d prod-db
# Confirmation will be requested for safety

Good memory entries:

Terminal window
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:

Terminal window
# Too vague
saber memory add "Calculate things properly"
saber memory add "Use the right formula"

Check memory commands and options:

Terminal window
saber memory --help
saber memory add --help
saber memory list --help

With memory configured:

  1. Learn advanced querying techniques
  2. Manage conversation threads with consistent context
  3. Explore different models and see how they use memory
  4. Review the command reference for all memory options