Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: explicitly add remember_memory tool in the instructions/system prompt #965

Merged
merged 1 commit into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions crates/goose-mcp/src/memory/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ impl MemoryRouter {
2. Search memories by content or specific tags to find relevant information.
3. List all available memory categories for easy navigation.
4. Remove entire categories of memories when they are no longer needed.
When to call memory tools:
- These are examples where the assistant should proactively call the memory tool because the user is providing recurring preferences, project details, or workflow habits that they may expect to be remembered.
- Preferred Development Tools & Conventions
- User-specific data (e.g., name, preferences)
- Project-related configurations
- Workflow descriptions
- Other critical settings
Interaction Protocol:
When important information is identified, such as:
- User-specific data (e.g., name, preferences)
Expand All @@ -115,6 +122,8 @@ impl MemoryRouter {
- Confirm the desired storage location:
- Local storage (.goose/memory) for project-specific details.
- Global storage (~/.config/goose/memory) for user-wide data.
- Use the remember_memory tool to store the information.
- `remember_memory(category, data, tags, is_global)`
Example Interaction for Storing Information:
User: "For this project, we use black for code formatting"
Assistant: "You've mentioned a development preference. Would you like to remember this for future conversations?
Expand Down
2 changes: 2 additions & 0 deletions crates/goose/src/truncate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ pub trait TruncationStrategy {

/// Strategy to truncate messages by removing the oldest first
pub struct OldestFirstTruncation;
/// Strategy to truncate messages explicitly
pub struct ExplicitTruncation;

impl TruncationStrategy for OldestFirstTruncation {
fn determine_indices_to_remove(
Expand Down
Loading