-
Notifications
You must be signed in to change notification settings - Fork 3
Improve SDK positioning, code quality, tests, and documentation #7
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
cpfiffer
wants to merge
17
commits into
main
Choose a base branch
from
cpfiffer/context-scoping
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
- Context-aware APIs (Python + TS) - Unified add_messages: user or bound-context - Keep user-specific helpers for compatibility - Add examples (Python/TS) - Add offline context tests (Python/TS) - Update docs; add src/python/README.md - Remove sanitization; document naming conventions
…dk' to agent tags (Python + TS)\n- Include tag on initialization passages and archival messages\n- Include SDK tag in context tag helper (TS + Python)\n- Keep queries unchanged for compatibility
…+ 'user'; document SDK tagging\n\n- Python: search(user_id, query, tags=...)\n- TS: search(userId, query, tags?)\n- Docs: update search docs and add SDK tagging notes
- Python: subject_id, initialize_subject, add_messages_for_subject, subj: tags, agent name prefix - TS: subjectId, initializeSubject, addMessagesToSubject, subj: tags, agent name prefix - Rename examples and tests to subject variants - Update READMEs and tutorial to Subject Model
…ject helpers; update docs and comments
…move user helpers down; emphasize generic memory blocks
…move user helpers down; emphasize generic memory blocks
…gement; align terminology with Letta docs (core memory, archival memory, blocks); emphasize Letta agent architecture
…t_for_run, enhance docstrings, align all docs with Letta-centric positioning
- Add test_timeout.py: verify timeout behavior in wait_for_run - Add test_edge_cases.py: test error handling, block reset, multiple blocks, empty values, special characters, and more - Tests run offline with mocked Letta client
- archival_search.py: demonstrates semantic search over conversation history - customer_support.py: real-world multi-block use case (profile, history, policies) - examples/README.md: guide to all examples with selection criteria and tips
- Remove AsyncLetta client dependency - Convert _learn_messages to synchronous _learn_messages_sync - Use sync client for passage creation to avoid event loop closure issues - Passages are now created sequentially instead of in parallel (simpler and more reliable)
…, update examples list in README
Change default search tags from ["ai-memory-sdk", "user"] to ["user"] to work around Letta API issue where multi-tag searches return empty results regardless of tag_match_mode setting. - Update search() method to use single tag by default - Add comprehensive bug report for Letta team - Fixes test_messages.py::test_conversational_memory failure
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
This PR significantly enhances the AI Memory SDK with improved Letta positioning, code quality improvements, comprehensive test coverage, and practical examples.
Changes
1. Positioning & Documentation (4 commits)
Position SDK as lightweight wrapper around Letta's memory management
Align terminology with Letta docs
Documentation updates
2. Code Quality Improvements (2 commits)
Fixed bugs and typos
asyncio
importAdded timeout feature
wait_for_run()
now has configurable timeout (300s default)TimeoutError
when run doesn't complete in timeEnhanced docstrings
initialize_user_memory()
_learn_messages_sync()
Fixed async event loop issue
AsyncLetta
client dependencyRuntimeError: Event loop is closed
when usingskip_vector_storage=False
3. Test Coverage (1 commit)
Added 13 new offline unit tests across 2 test files:
test_timeout.py (2 tests):
wait_for_run()
test_edge_cases.py (9 tests):
All tests use mocked Letta client for offline execution.
4. Practical Examples (1 commit)
Added 2 new educational examples and comprehensive guide:
archival_search.py:
skip_vector_storage=False
customer_support.py:
examples/README.md:
5. Review Cleanup (1 commit)
asyncio
importTesting
Documentation
All documentation is now:
Breaking Changes
None. All changes are backward compatible.
Related Issues
Addresses documentation clarity and code quality improvements throughout the SDK.