feat: add soul_sync MCP tool — one-call auto-recall + auto-observe - #320
Open
sshekhar563 wants to merge 2 commits into
Open
sshekhar563 wants to merge 2 commits into
sshekhar563 wants to merge 2 commits into
Conversation
- Add AutoObserveMiddleware (auto_observe.py): wraps a Soul so every conversation turn is captured automatically. Single turn() method performs optional recall + mandatory observe, returning memories and soul state. - Add soul_sync MCP tool (server.py): exposes AutoObserveMiddleware as an MCP tool so agents sync a turn in one round-trip instead of separate soul_recall + soul_observe calls. - Export AutoObserveMiddleware from middleware __init__.py - Update CLI setup instructions to reference soul_sync - Update README MCP tools documentation - Add tests: test_soul_sync_observe_only, test_soul_sync_with_recall, test_auto_observe_middleware unit tests
test_registered_tool_list_matches_public_mcp_surface pins the exact set of registered MCP tools; the new soul_sync tool was missing from EXPECTED_MCP_TOOLS, failing CI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds
soul_sync— a new MCP tool that combines auto-recall + auto-observe into a single call. Agents sync a conversation turn with the soul in one round-trip instead of callingsoul_recallthensoul_observeseparately.New:
AutoObserveMiddlewareSoulso every conversation turn is captured automaticallyturn()method: optional recall (whenqueryis provided) + mandatory observeNew:
soul_syncMCP toolAutoObserveMiddlewareas an MCP tooluser_input,agent_output,query,limit,channel,soul,user_id,layer,domainFiles changed
src/soul_protocol/runtime/middleware/auto_observe.pyAutoObserveMiddlewareclasssrc/soul_protocol/runtime/middleware/__init__.pyAutoObserveMiddlewaresrc/soul_protocol/mcp/server.pysoul_synctoolsrc/soul_protocol/cli/setup.pyREADME.mdtests/test_mcp/test_server.pytests/test_memory_layers/test_auto_observe_middleware.pyHow to test
Checklist