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

refactor!: Migrate users + agent information into storage connectors #785

Merged
merged 69 commits into from
Jan 8, 2024

Conversation

sarahwooders
Copy link
Collaborator

@sarahwooders sarahwooders commented Jan 4, 2024

Please describe the purpose of this pull request.

  • Refactor Config to User record
  • Refactor AgentConfig to AgentState record
  • Refactor Agent init and save to use AgentState

Todos

  • Add user_id field to commands (default to config.anon_clientid if not provided)
    • Data loading (cli_load.py)
    • Configuration (cli_configure.py)
      • Create row in User table if config.anon_clientid does not exist
    • MemGPT run (cli.py)
      • Lookup agents from metadata store, and insert new AgentState objects if new one is created
    • Metadata listing (e.g. listing sources, agents, etc.)
  • Migrate all references to StorageConnector to pass in user_id, and optionally agent_id (if recall/archival memory)
  • Check that run and configure work
  • Ensure tests are all working
  • Update tests to use new metadata store + storage connectors

Remaining todos:

  • Adapt record.text to be record.content, which can be a List of strings.
  • Update all instances of create_agent_from_preset to use correct format
  • Remove all references of AgentConfig and replace them with AgentState, which can be looked up from the metadata store

How to test

  • Regression test (unit tests should cover)
  • Make sure that persistence manager is persisting (manual DB inspection and/or save+load)

Have you tested this PR?

WIP

@cpacker cpacker force-pushed the refactor-agent-storage branch from a95f250 to c00b40c Compare January 4, 2024 23:19
@cpacker cpacker changed the title Migrate users + agent information into storage connectors refactor: Migrate users + agent information into storage connectors Jan 4, 2024
@cpacker cpacker changed the title refactor: Migrate users + agent information into storage connectors refactor!: Migrate users + agent information into storage connectors Jan 4, 2024
@cpacker cpacker self-assigned this Jan 5, 2024
memgpt/agent.py Outdated Show resolved Hide resolved
memgpt/agent.py Outdated Show resolved Hide resolved
memgpt/cli/cli.py Outdated Show resolved Hide resolved
memgpt/cli/cli.py Outdated Show resolved Hide resolved
memgpt/data_types.py Outdated Show resolved Hide resolved
memgpt/agent_store/local.py Outdated Show resolved Hide resolved
@sarahwooders sarahwooders merged commit 8c06cc4 into main Jan 8, 2024
4 checks passed
@sarahwooders sarahwooders deleted the refactor-agent-storage branch January 8, 2024 23:59
norton120 pushed a commit to norton120/MemGPT that referenced this pull request Feb 15, 2024
mattzh72 pushed a commit that referenced this pull request Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority Merge ASAP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants