feat: raise default query limits to 10000 (effectively unlimited)
With 375 memories and 1M context window, low limits just hide results. Agents can still pass a smaller limit when they want fewer results. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
43a5513f6c
commit
d03a77ac36
3 changed files with 6 additions and 6 deletions
|
|
@ -289,7 +289,7 @@ async def recall_memories(body: MemoryRecall, user: AuthUser = Depends(get_curre
|
||||||
async def list_memories(
|
async def list_memories(
|
||||||
category: Optional[str] = None,
|
category: Optional[str] = None,
|
||||||
tag: Optional[str] = None,
|
tag: Optional[str] = None,
|
||||||
limit: int = 50,
|
limit: int = 10000,
|
||||||
offset: int = 0,
|
offset: int = 0,
|
||||||
user: AuthUser = Depends(get_current_user),
|
user: AuthUser = Depends(get_current_user),
|
||||||
) -> dict[str, Any]:
|
) -> dict[str, Any]:
|
||||||
|
|
@ -862,7 +862,7 @@ async def memory_store(content: str, category: str = "facts", tags: str = "",
|
||||||
@mcp_server.tool()
|
@mcp_server.tool()
|
||||||
async def memory_recall(context: str, expanded_query: str = "",
|
async def memory_recall(context: str, expanded_query: str = "",
|
||||||
category: str | None = None, sort_by: str = "importance",
|
category: str | None = None, sort_by: str = "importance",
|
||||||
limit: int = 10) -> str:
|
limit: int = 10000) -> str:
|
||||||
"""Recall memories by semantic search."""
|
"""Recall memories by semantic search."""
|
||||||
pool = await get_pool()
|
pool = await get_pool()
|
||||||
user_id = _current_user.get()
|
user_id = _current_user.get()
|
||||||
|
|
@ -922,7 +922,7 @@ async def memory_recall(context: str, expanded_query: str = "",
|
||||||
|
|
||||||
|
|
||||||
@mcp_server.tool()
|
@mcp_server.tool()
|
||||||
async def memory_list(category: str | None = None, limit: int = 20) -> str:
|
async def memory_list(category: str | None = None, limit: int = 10000) -> str:
|
||||||
"""List stored memories."""
|
"""List stored memories."""
|
||||||
pool = await get_pool()
|
pool = await get_pool()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ class MemoryRecall(BaseModel):
|
||||||
expanded_query: str = ""
|
expanded_query: str = ""
|
||||||
category: Optional[str] = None
|
category: Optional[str] = None
|
||||||
sort_by: Literal["importance", "relevance", "recency"] = "importance"
|
sort_by: Literal["importance", "relevance", "recency"] = "importance"
|
||||||
limit: int = Field(default=10, ge=1, le=500)
|
limit: int = Field(default=10000, ge=1, le=10000)
|
||||||
|
|
||||||
|
|
||||||
class MemoryResponse(BaseModel):
|
class MemoryResponse(BaseModel):
|
||||||
|
|
|
||||||
|
|
@ -89,10 +89,10 @@ def test_invalid_sort_by_rejected(sort_by):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@given(limit=st.integers(min_value=501, max_value=10000))
|
@given(limit=st.integers(min_value=10001, max_value=50000))
|
||||||
@settings(max_examples=10)
|
@settings(max_examples=10)
|
||||||
def test_limit_too_high_rejected(limit):
|
def test_limit_too_high_rejected(limit):
|
||||||
"""Limit above 500 is rejected after model update."""
|
"""Limit above 10000 is rejected after model update."""
|
||||||
try:
|
try:
|
||||||
MemoryRecall(context="test", limit=limit)
|
MemoryRecall(context="test", limit=limit)
|
||||||
assert False, "Should have raised ValidationError"
|
assert False, "Should have raised ValidationError"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue