Skip to content
This repository was archived by the owner on May 12, 2026. It is now read-only.

Memory SDK更新 - #51

Open
taoquanyus wants to merge 4 commits into
agentscope-ai:mainfrom
taoquanyus:modelstudio_memory
Open

Memory SDK更新#51
taoquanyus wants to merge 4 commits into
agentscope-ai:mainfrom
taoquanyus:modelstudio_memory

Conversation

@taoquanyus

@taoquanyus taoquanyus commented Dec 2, 2025

Copy link
Copy Markdown

Description

[Describe what this PR does and why]

  1. Memory SDK更新, 新增Profile相关接口
  2. 修改Memory演示DEMO,提升可读性

后续将整体迁移至Agentscope-runtime
Related Issue: Fixes #[issue_number] or Relates to #[issue_number]

Security Considerations: [If applicable, especially for sandbox changes]

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Refactoring

Component(s) Affected

  • Engine
  • Sandbox
  • Documentation
  • Tests
  • CI/CD

Checklist

  • Pre-commit hooks pass
  • Tests pass locally
  • Documentation updated (if needed)
  • Ready for review

Testing

[How to test these changes]

Additional Notes

[Optional: any other context]

- Add CreateProfileSchema component to create user profile schemas
- Add GetUserProfile component to retrieve user profiles by schema and user ID
- Update memory service endpoints for profile-related operations
- Refactor delete memory operation to use DELETE HTTP method
- Change list memory operation to use GET HTTP method with query params
- Add model validators and improve input/output data models
- Update URL patterns for memory node operations
- Introduce new data models for profile attributes and user profiles
- Replace actual DashScope API key with placeholder value
- Maintain existing environment variable structure
- Preserve all other configuration settings unchanged

docs(examples): remove memory_with_llm.py from example files

- Removed memory_with_llm.py from components README documentation
- Removed memory_with_llm.py execution command from example instructions

feat(memory): enhance error handling and memory node parsing

- Add MemoryValidationError exception for 400 status codes
- Improve error response parsing with JSON/text fallback
- Extract and log detailed error information (code, message, request ID)
- Handle both list and dict formats for memory nodes in API responses
- Add comprehensive error handling in demo examples
- Update exception classes with optional error code and request ID fields
- Format error messages with all available error details
- Add debug logging for API response structures
- Wrap single memory nodes in lists for consistent processing
- Improve exception re-raising with proper error information preservation

feat(memory): enhance user profile extraction and display in memory demo

- Improved explanation of automatic memory and profile extraction
- Enhanced dialogue display with highlighting of profile-related content
- Added visual formatting for user profile and schema information
- Included waiting logic to ensure profile extraction completion
- Updated demo flow to showcase extracted user profile features

feat(memory): add memory demo with profile and LLM integration

- Created a comprehensive memory demo showcasing core functionalities
- Implemented user profile schema creation and management
- Added example dialogue processing with automatic memory extraction
- Integrated memory listing with pagination support
- Enabled semantic memory search combined with LLM response generation
- Included user profile retrieval based on custom schemas
- Provided memory cleanup and resource management utilities
- Added bash script for easy demo execution and environment setup
- Fixed asyncio sleep calls in existing memory examples
- Enhanced logging configuration and error handling
- Improved console output formatting and user experience

feat(memory): implement ModelStudio Memory components and services

- Added core memory components: AddMemory, SearchMemory, ListMemory, DeleteMemory
- Implemented user profile management: CreateProfileSchema, GetUserProfile
- Created base class ModelStudioMemoryBase with common API functionality
- Added comprehensive error handling with custom exception types
- Included configuration management through MemoryServiceConfig
- Provided Pydantic models for all input/output data structures
- Added support for async operations and session management
- Implemented proper HTTP request handling with authentication
- Added detailed logging for debugging and monitoring
- Organized code into modular structure with clear separation of concerns
- Reformat Python files to adhere to consistent style guidelines
- Improve error handling in ModelStudioMemoryBase by refining exception catching
- Update configuration parsing to streamline environment variable usage
- Adjust demo script formatting and enhance debugging output
- Remove unused example component file
- Modify model descriptions for clarity and conciseness
- Removed extra backslash escape characters in user message content
- Improved line continuation formatting for better readability
- Maintained same conversational context and information structure
@cla-assistant

cla-assistant Bot commented Dec 2, 2025

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant