Skip to content

Add a long-term memory interface #25

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

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

abrookins
Copy link
Contributor

Move vector search over long-term memories into a new VectorStoreAdapter interface instead of only including a concrete Redis implementation. Satisfies the new interface with a generic adapter supporting LangChain VectorStore instances. Then satisfies the same interface with the langchain-redis RedisVectorStore, making Redis the default long-term storage layer.

abrookins and others added 4 commits June 2, 2025 11:07
- Removed duplicate session endpoints from api.py in favor of v1 API structure
- Kept vectorstore adapter approach in long_term_memory.py over direct Redis operations
- Used feature branch version of uv.lock for latest dependencies

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Configure agent-memory-client as workspace member
- Fix ULID field generation in LenientMemoryRecord model
- Note: Some tests need updating for new MemoryRecord API structure

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@Copilot Copilot AI review requested due to automatic review settings June 25, 2025 23:39
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Introduce a pluggable VectorStoreAdapter interface to support multiple LangChain vector backends for long-term memory storage, with Redis as the default.

  • Define VectorStoreAdapter abstraction with LangChainVectorStoreAdapter and RedisVectorStoreAdapter.
  • Refactor core long‐term memory functions (index_, search_, count_) to delegate to the adapter.
  • Update configuration, dependencies, documentation, and tests to cover new backends.

Reviewed Changes

Copilot reviewed 20 out of 22 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
agent_memory_server/vectorstore_adapter.py Added adapter interface and implementations
agent_memory_server/vectorstore_factory.py Factory logic for selecting and creating adapters
agent_memory_server/long_term_memory.py Refactored indexing/search/count to use adapter
agent_memory_server/config.py Extended settings for backend and RedisVL names
pyproject.toml Updated dependencies and extras for backends
docs/vector-store-backends.md New documentation listing supported backends
tests/test_vectorstore_adapter.py Added unit tests for adapter methods
tests/test_memory_compaction.py Updated compaction tests to use adapter
tests/test_long_term_memory.py Refactored long-term memory tests to patch adapter
tests/conftest.py Patching of Redis connections and global state
Comments suppressed due to low confidence (3)

tests/test_memory_compaction.py:165

  • [nitpick] Remove debug print statements to keep test output clean; use assertions or logs if inspection is needed.
    print(f"🔍 Redis keys after indexing: {keys}")

tests/test_vectorstore_adapter.py:221

  • Add a test case for delete_memories with non-empty input to verify that deletion logic returns the correct count and propagates to the underlying store.
        deleted = await adapter.delete_memories([])

tests/test_memory_compaction.py:176

  • [nitpick] Remove debug print statements to keep test output clean; rely on assertions rather than printing.
    )

@abrookins
Copy link
Contributor Author

@claude Resolve these conflicts.

Copy link
Contributor

claude bot commented Jun 25, 2025

Claude encountered an error —— View job


I'll analyze this and get back to you.

@abrookins abrookins marked this pull request as draft June 26, 2025 00:07
abrookins and others added 6 commits June 25, 2025 17:09
- Resolved ULID import conflicts in models and client files
- Fixed README.md merge conflict preserving vector store backends doc
- Resolved pyproject.toml dependency conflicts
- Fixed test file conflicts and cleaned up malformed merge resolutions
- Preserved all vector store adapter functionality and interface
- Tests passing, vector store factory working correctly

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@abrookins abrookins marked this pull request as ready for review June 27, 2025 00:12
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.

1 participant