-
Notifications
You must be signed in to change notification settings - Fork 1
Add a CLI #5
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
Conversation
There was a problem hiding this 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 introduces a CLI interface for agent-memory-server enabling background task management and API serving via command-line commands, while deprecating the legacy Python worker approach. Key changes include:
- Adding new CLI commands (version, api, mcp, schedule_task, task_worker) using Click.
- Introducing tests for CLI commands in test_cli.py.
- Removing the legacy worker module and updating dependency configurations and key utility functions.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
test_cli.py | Adds tests to verify the registration and execution of new CLI commands. |
pyproject.toml | Adds the Click dependency and defines the script entry point for the CLI. |
agent_memory_server/worker.py | Removes the legacy in-process Docket worker implementation. |
agent_memory_server/utils/keys.py | Updates the search index retrieval to use the value from settings. |
agent_memory_server/long_term_memory.py | Modifies asynchronous handling for fetching the search index and cleans up TODO comments. |
agent_memory_server/docket_tasks.py | Registers the newly added compact_long_term_memories task with the docket task list. |
agent_memory_server/cli.py | Implements all new CLI commands for server operations and task scheduling. |
README.md | Updates the “Contributing” section formatting. |
Comments suppressed due to low confidence (1)
agent_memory_server/utils/keys.py:61
- [nitpick] The setting name 'redisvl_index_name' appears ambiguous; please verify if it is intentional or a typo for 'redis_index_name'.
return settings.redisvl_index_name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super cool!
multiple=True, | ||
help="Arguments to pass to the task in the format key=value", | ||
) | ||
def schedule_task(task_path: str, args: list[str]): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooo I may very well steal this for Docket :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hah! Nice! This was my MVP for scheduling recurring tasks. Cron, here we come!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh! Check out Perpetual
, it's not documented that awesomely, but I think it's what you're looking for: https://github.com/chrisguidry/docket/blob/main/tests/test_fundamentals.py#L973-L997
Docket doesn't have cron syntax, but it can reschedule tasks on intervals forever
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh nice, I'll check that out!
Co-authored-by: Chris Guidry <[email protected]>
Now you can run a background task from the CLI, allowing an external scheduler to kick off periodic memory compaction (and more).