feat: auto-split large memories at store time (>500 chars)
When content exceeds 500 chars, it's automatically split into multiple memories on paragraph boundaries. Each chunk gets the same category, tags (with part-N-of-M suffix), keywords, and importance. Removes the old 800 char hard limit from the Pydantic model. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
c88dd03cce
commit
73aefda82e
3 changed files with 56 additions and 27 deletions
|
|
@ -3,11 +3,8 @@ from typing import Any, Literal, Optional
|
|||
from pydantic import BaseModel, Field
|
||||
|
||||
|
||||
MAX_MEMORY_CHARS = 800
|
||||
|
||||
|
||||
class MemoryStore(BaseModel):
|
||||
content: str = Field(..., max_length=MAX_MEMORY_CHARS)
|
||||
content: str
|
||||
category: str = "facts"
|
||||
tags: str = Field(default="", max_length=500)
|
||||
expanded_keywords: str = Field(default="", max_length=500)
|
||||
|
|
@ -57,7 +54,7 @@ class UnshareTag(BaseModel):
|
|||
|
||||
|
||||
class MemoryUpdate(BaseModel):
|
||||
content: Optional[str] = Field(None, max_length=MAX_MEMORY_CHARS)
|
||||
content: Optional[str] = None
|
||||
tags: Optional[str] = None
|
||||
importance: Optional[float] = Field(None, ge=0.0, le=1.0)
|
||||
expanded_keywords: Optional[str] = None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue