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

add an client-direct endpoint to get memories by agentid and roomid #1581

Merged
merged 3 commits into from
Dec 31, 2024

Conversation

treppers
Copy link
Contributor

Relates to:

Risks

Low. This change adds a new API endpoint for fetching memories, which should not affect existing functionality.

Background

What does this PR do?

This PR adds a new API endpoint /agents/:agentId/:roomId/memories to fetch memories for a specific agent and room. This enhancement supports improved web-based chat capabilities with Eliza characters.

What kind of change is this?

Features (non-breaking change which adds functionality)

Why are we doing this? Any context or related work?

Mee.fun a hosted Eliza service, want to add a web-based chat UI. In order to do this history of the chat needs to be retrievable.

Documentation changes needed?

My changes require a change to the project documentation. The new API endpoint should be documented in the appropriate API documentation.

Testing

Where should a reviewer start?

  1. Review the new route added in packages/client-direct/src/api.ts
  2. Check the structure of the response in the /agents/:agentId/:roomId/memories endpoint

Detailed testing steps

  1. Start the server
  2. Use a tool like Postman or curl to make a GET request to /agents/{agentId}/{roomId}/memories, replacing {agentId} and {roomId} with valid IDs
  3. Verify that the response includes the correct structure with agentId, roomId, and an array of memories
  4. Check that each memory in the response includes all the fields from the Memory interface
  5. Test with invalid agentId to ensure a 404 response is returned
  6. Test with a valid agentId but no memories to ensure an empty array is returned

Discord username

treppers

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Hi @treppers! Welcome to the ai16z community. Thanks for submitting your first pull request; your efforts are helping us accelerate towards AGI. We'll review it shortly. You are now a ai16z contributor!

monilpat
monilpat previously approved these changes Dec 31, 2024
Copy link
Collaborator

@monilpat monilpat left a comment

Choose a reason for hiding this comment

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

Thanks so much for doing this it has been such a pain to have to call const memories = await runtime.messageManager.getMemories({ roomId, }); everytime we want to see this during our test runs glad there is a route now :)

packages/client-direct/src/api.ts Show resolved Hide resolved
packages/client-direct/src/api.ts Show resolved Hide resolved
@monilpat monilpat changed the base branch from main to develop December 31, 2024 00:01
@monilpat monilpat dismissed their stale review December 31, 2024 00:01

The base branch was changed.

Copy link
Collaborator

@monilpat monilpat left a comment

Choose a reason for hiding this comment

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

Going to merge this in as all nits

Copy link
Collaborator

@monilpat monilpat left a comment

Choose a reason for hiding this comment

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

LGTM nits are fine

@monilpat monilpat merged commit 20090bf into elizaOS:develop Dec 31, 2024
3 checks passed
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