Add optional Letta memory integration for cross-session recall#39
Open
shranchi0 wants to merge 3 commits into
Open
Add optional Letta memory integration for cross-session recall#39shranchi0 wants to merge 3 commits into
shranchi0 wants to merge 3 commits into
Conversation
Adds an opt-in session memory feature powered by Letta that records session lifecycle events (created, ended, errors, state changes) and lets users query past context via natural language. New files: - tame/integrations/letta/ — client wrapper, event bridge, agent prompt - tame/ui/widgets/memory_dialogs.py — enable, recall, and clear dialogs Integration points: - app.py: conditional bridge init, session lifecycle hooks, 3 new actions (toggle_memory, recall_memory, clear_memory) - command_palette.py: y/a/j keys for memory commands - status_bar.py: [Memory: On/Off] indicator - config/defaults.py: [letta] section (enabled, server_url) - pyproject.toml: optional "memory" extra (letta-client) The feature is completely inert when letta-client is not installed. When installed but not enabled, only a status bar indicator appears.
When user toggles memory on for the first time, TAME now handles the full setup automatically: 1. Installs letta-client via uv if not present 2. Starts letta server as a background subprocess 3. Waits for server readiness (health endpoint polling) 4. Connects and creates the memory agent On subsequent TAME launches, auto-connects to the running server. On TAME exit, the background server is cleaned up. The onboarding dialog adapts its text based on whether letta-client needs to be installed or is already present.
mypy caught that _run_memory_setup() (async) was called without await from the sync callback _handle_memory_enable. Use self.call_later() to schedule it on the Textual event loop instead.
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.
Summary
letta-clientis not installed, and dormant when installed but not enabledpip install tame[memory], then toggle on via command palette (y)How it works
yin command palette): First use shows an onboarding dialog explaining the feature. Subsequent uses toggle on/off instantly.ain command palette): Opens a dialog where you can ask questions like "what fixed the timeout error?" — the Letta agent searches its archival memory of past session eventsjin command palette): Wipes all stored session memory (with confirmation)[Memory: On],[Memory: Off], or[Memory: ⚠]when letta-client is installedWhat gets recorded (when enabled)
Architecture
Files changed
tame/integrations/letta/— client, bridge, promptstame/ui/widgets/memory_dialogs.py— enable, recall, clear modalstame/app.py— conditional bridge init, lifecycle hooks, 3 actionstame/ui/widgets/command_palette.py— y/a/j entriestame/ui/widgets/status_bar.py— memory indicatortame/config/defaults.py—[letta]config sectionpyproject.toml—memoryoptional extraTest plan
ruff checkpassesruff format --checkpassesletta-client, runletta server, toggle memory on, create/kill sessions, use "Ask Memory"letta-client