Skip to content

Index discrete memories in long-term storage, add a new memory prompt REST API endpoint, and YAML config #9

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

Merged
merged 7 commits into from
May 23, 2025

Conversation

abrookins
Copy link
Contributor

Adds a few features:

  1. Allow storing settings in a YAML file instead of just environment variables (still available as well).
  2. Add an option that enables extracting discrete memories from messages for long-term storage, using an LLM, in addition to the current strategy of indexing the messages themselves.
  3. Move the "memory prompt" from the MCP implementation into a core REST service, so it's available in both places. Clients can use this to send input text and get back a set of messages that include any relevant context found in memory, both the messages in the current session (if one is stored) and any relevant memories found via semantic search.

@Copilot Copilot AI review requested due to automatic review settings May 20, 2025 20:30
@abrookins abrookins changed the title Index discrete memories in long-term storage, a new memory prompt, and YAML config Index discrete memories in long-term storage, add a new memory prompt REST API endpoint, and YAML config May 20, 2025
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

This PR centralizes configuration in YAML, enhances memory handling, and promotes reuse of the memory prompt across services.

  • Load settings from a YAML file (with env-var overrides) via Settings and load_yaml_settings.
  • Add discrete memory extraction toggle during long-term indexing.
  • Refactor the “hydrate_memory_prompt” tool into a core /memory-prompt API with MemoryPromptRequest/Response.

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/test_models.py Rename SearchPayloadSearchRequest
tests/test_mcp.py Update tool name to "memory_prompt" and response parsing
tests/test_extraction.py Switch topic extraction calls to extract_topics_bertopic and add integration tests
tests/test_api.py Add validation of /memory-prompt responses and combine session & long-term memory
agent_memory_server/test_config.py Add tests for YAML loading and env-var overrides
agent_memory_server/config.py Implement load_yaml_settings, support YAML + env-vars
agent_memory_server/models.py Add new request/response models and rename payloads
agent_memory_server/mcp.py Rename MCP tool, delegate to core memory prompt API
agent_memory_server/long_term_memory.py Invoke discrete memory extraction conditionally
agent_memory_server/extraction.py Rename NER extraction to extract_topics_bertopic and unify path logic
agent_memory_server/api.py Create /memory-prompt endpoint and helper for window sizing
agent_memory_server/client/api.py Update client methods for new request models
.env.example Rename MAX_WINDOW_SIZEWINDOW_SIZE
Comments suppressed due to low confidence (1)

agent_memory_server/api.py:42

  • get_model_config is not imported or defined in this module, leading to a NameError when model_name is provided. Add from agent_memory_server.api import get_model_config (or the correct import path) at the top.
model_config = get_model_config(model_name)

@abrookins abrookins merged commit 7f97e9c into main May 23, 2025
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.

1 participant