feat(memory): add session-based chat history and user metadata retrieval

- Add ChatSessionCache to manage chat history per session
- Add SEARCH_USER_METADATA cypher query for retrieving user entity metadata
- Add "str" mode support to StructResponse for raw text extraction
- Add content_str field to MemorySearchResult for pre-formatted content
- Fix sandbox URL by removing hardcoded port
- Add description field to entity search results
- Remove history from UserInput schema, use session_id instead
This commit is contained in:
Eternity
2026-05-06 16:24:53 +08:00
parent 6b68ee9fc8
commit 3f9740412a
19 changed files with 387 additions and 117 deletions

View File

@@ -1,14 +1,15 @@
import uuid
from abc import ABC
from typing import Optional
from pydantic import BaseModel
from pydantic import BaseModel, Field
class UserInput(BaseModel):
message: str
history: list[dict]
search_switch: str
end_user_id: str
session_id: uuid.UUID = Field(default_factory=uuid.uuid4)
config_id: Optional[str] = None