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

feat: memory server #601

Open
wants to merge 4 commits into
base: v1.0
Choose a base branch
from
Open

feat: memory server #601

wants to merge 4 commits into from

Conversation

wendytang
Copy link
Collaborator

@wendytang wendytang commented Jan 15, 2025

Brings forward memory server.

Example Usage:

  • "remember the fitness goal for 2025 is to do x pushups" -> remember tool call
  • "what was my fitness goal?" -> retrieve tool call
  • "i don't want to do the pushup goal anymore, please erase it" -> remove specific memory
image

Notes

  • Memory server is implemented with tool calls.
  • Remembered files are added as Active Resources for when Resources are incorporated. This can also be easily removed.
  • (in-progress)Testing in session

Copy link

Desktop App for this PR

The following build is available for testing:

The app is signed and notarized for macOS. After downloading, unzip the file and drag the Goose.app to your Applications folder.

This link is provided by nightly.link and will work even if you're not logged into GitHub.

Copy link

Desktop App for this PR

The following build is available for testing:

The app is signed and notarized for macOS. After downloading, unzip the file and drag the Goose.app to your Applications folder.

This link is provided by nightly.link and will work even if you're not logged into GitHub.

@Kvadratni
Copy link
Collaborator

I love this more refined approach to the same simple file based idea.

Copy link

Desktop App for this PR

The following build is available for testing:

The app is signed and notarized for macOS. After downloading, unzip the file and drag the Goose.app to your Applications folder.

This link is provided by nightly.link and will work even if you're not logged into GitHub.

Copy link

Desktop App for this PR

The following build is available for testing:

The app is signed and notarized for macOS. After downloading, unzip the file and drag the Goose.app to your Applications folder.

This link is provided by nightly.link and will work even if you're not logged into GitHub.

@wendytang wendytang marked this pull request as ready for review January 15, 2025 22:07
@salman1993
Copy link
Collaborator

I tested this out with goosed but it didn't work for me. I tried with both the default and the reference agent versions. This is what I tried:

  1. checkout this branch and merge in latest changes - git merge origin/v1.0
  2. create an agent
curl --request POST \
  --url http://localhost:3000/agent \
  --header 'Content-Type: application/json' \
  --header 'X-Secret-Key: test' \
  --data '{
  "version": "default",  # also tried "reference" here
  "provider": "databricks"
}'
  1. add memory system
curl --request POST \
  --url http://localhost:3000/systems/add \
  --header 'Content-Type: application/json' \
  --header 'X-Secret-Key: test' \
  --data '{
  "type": "Stdio",
  "cmd": "cargo", 
  "args": ["run", "--bin", "goosed", "--", "mcp", "memory"]
}'
  1. remember memory - this succeeds
curl --request POST \
  --url http://localhost:3000/reply \
  --header 'Accept: text/event-stream' \
  --header 'Content-Type: application/json' \
  --header 'X-Secret-Key: test' \
  --header 'x-protocol: data' \
  --data '{
  "messages": [
    {
      "role": "user",
      "content": "remember my global goal of 20 pushups a day for category '\''fitness'\''"
    }
  ]
}'

Screenshot 2025-01-16 at 11 02 20 AM

  1. retrieve memory - this fails with 2 possible errors - (1) data must be string, (2) server error
curl --request POST \
  --url http://localhost:3000/reply \
  --header 'Accept: text/event-stream' \
  --header 'Content-Type: application/json' \
  --header 'X-Secret-Key: test' \
  --header 'x-protocol: data' \
  --data '{
  "messages": [
    {
      "role": "user",
      "content": "retrieve my global memories for category '\''fitness'\''"
    }
  ]
}'

error - data must be a string:
Screenshot 2025-01-16 at 11 02 58 AM

error - Server error: Server error occured. Status: 503 Service Unavailable
Screenshot 2025-01-16 at 10 48 27 AM

also see these logs in goosed agent:
Screenshot 2025-01-16 at 10 49 55 AM


let data = args["data"]
.as_str()
.ok_or_else(|| io::Error::new(io::ErrorKind::InvalidInput, "Data must be a string"))?;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this fails for retrieve_memories which doesn't have a 'data' property in the JSON schema

@salman1993
Copy link
Collaborator

the fix was easy - needed to make data field optional. i put the changes here if you wanna merge to this branch - #629

i'm not sure why the Inspector tool did not catch this. i think it'd be good to test this out more thoroughly via goosed, here are some things i'd recommend testing:

  1. try adding 'developer2' and 'memory' system. ask questions that require using a tool from each of those systems
  2. edge cases - try to make the memory fail with confusing categories or is_global or not
  3. retrieving a memory 5-6 msgs later in the conversation (this will test out the prompting in some sense)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants