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: add archival memory GET, POST, DEL to REST API #1119

Merged
merged 6 commits into from
Mar 9, 2024

Conversation

cpacker
Copy link
Owner

@cpacker cpacker commented Mar 9, 2024

Add API routes for archival memory to allow for displaying + editing archival memory contents inside the chat UI.

Please describe the purpose of this pull request.

Adds the following API routes:

  • get_agent_archival_memory (NOTE: punting to later PR)
    • paginated query of archival memory contents
    • TODO currently untested, does not work on chroma
  • get_agent_archival_memory_all
    • unpaginated query of archival memory contents (returns ALL contents)
  • insert_agent_archival_memory
    • insert a string into archival memory
    • returns a list of record IDs (list because the input may be chunked)
  • delete_agent_archival_memory
    • delete an entry from archival memory

How to test

Note @sarahwooders this should really be rolled into a unit test but alas...

Example testing the routes:

  • create new agent (empty archival)
  • ask agent question about archival memory contents (gets answer wrong)
    • image
  • list contents of archival memory (empty)
    • image
  • insert into archival memory (via POST API)
    • image
  • list contents of archival memory (non-empty)
    • image
  • ask agent question about archival memory contents (gets answer correct)
    • image
  • delete archival memory content
    • image
  • list contents of archival memory (now empty again)
    • image

@cpacker cpacker added the API Related to MemGPT API label Mar 9, 2024
@cpacker cpacker marked this pull request as ready for review March 9, 2024 22:01
Copy link
Collaborator

@sarahwooders sarahwooders left a comment

Choose a reason for hiding this comment

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

lgtm!

@cpacker cpacker merged commit ff986ad into main Mar 9, 2024
4 checks passed
@cpacker cpacker deleted the archival-memory-api-routes branch March 9, 2024 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Related to MemGPT API
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants