docs(api-reference): address reviewer comments on search defaults table and retrieval_criteria shape
- search-memories.mdx: collapse V1/V2/V3 comparison table to a single "Default" column showing current (v3) values only (threshold 0.1, rerank false, top_k 10)
- organizations-projects.mdx: replace bogus {role, content} retrieval_criteria examples with the correct {name, description, weight} shape, mirroring the canonical criteria-retrieval.mdx examples; update prose to name the three required fields
This commit is contained in:
@@ -20,11 +20,11 @@ The `filters` object supports complex logical operations (AND, OR, NOT) and comp
|
|||||||
|
|
||||||
### Search parameter defaults
|
### Search parameter defaults
|
||||||
|
|
||||||
| Parameter | V1/V2 | V3 |
|
| Parameter | Default |
|
||||||
| --- | --- | --- |
|
| --- | --- |
|
||||||
| `top_k` | Supported (default 10) | Supported (1-1000, default 10) |
|
| `top_k` | `10` (range 1–1000) |
|
||||||
| `threshold` | V1: not supported / V2: default `0.3` | Default `0.1` (pass `0.0` to disable) |
|
| `threshold` | `0.1` (pass `0.0` to disable) |
|
||||||
| `rerank` | Default `false` | Default `false` (pass `true` to enable) |
|
| `rerank` | `false` (pass `true` to enable) |
|
||||||
|
|
||||||
<CodeGroup>
|
<CodeGroup>
|
||||||
```python Platform API Example
|
```python Platform API Example
|
||||||
|
|||||||
@@ -101,8 +101,8 @@ client.project.update(multilingual=True)
|
|||||||
# Set retrieval criteria to control which memories are surfaced in search
|
# Set retrieval criteria to control which memories are surfaced in search
|
||||||
client.project.update(
|
client.project.update(
|
||||||
retrieval_criteria=[
|
retrieval_criteria=[
|
||||||
{"role": "user", "content": "Only retrieve memories relevant to the current topic"},
|
{"name": "relevance", "description": "How directly relevant this memory is to the current topic or user query", "weight": 3},
|
||||||
{"role": "assistant", "content": "Prioritize recent and frequently accessed memories"}
|
{"name": "access_frequency", "description": "How often this memory has been accessed or surfaced recently", "weight": 1}
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -122,13 +122,26 @@ client.project.update(
|
|||||||
|
|
||||||
#### Set Retrieval Criteria
|
#### Set Retrieval Criteria
|
||||||
|
|
||||||
`retrieval_criteria` is a per-project list of dictionaries (`List[Dict]`) that shapes how memories are ranked and filtered during search. Each dictionary specifies a criterion that the retrieval engine applies when deciding which memories to surface. Use this to focus retrieval on topic-relevant or role-specific memories:
|
`retrieval_criteria` is a per-project list of dictionaries (`List[Dict]`) that shapes how memories are ranked and filtered during search. Each dictionary has three fields: `name` (identifier), `description` (interpreted by the LLM to score each memory), and `weight` (relative influence on the final score). Use this to focus retrieval on intent-aligned or signal-specific memories:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
client.project.update(
|
client.project.update(
|
||||||
retrieval_criteria=[
|
retrieval_criteria=[
|
||||||
{"role": "user", "content": "Only retrieve memories directly relevant to the user's current query"},
|
{
|
||||||
{"role": "assistant", "content": "Prefer memories that have been accessed recently"}
|
"name": "joy",
|
||||||
|
"description": "Measure the intensity of positive emotions such as happiness, excitement, or amusement expressed in the memory. A higher score reflects greater joy.",
|
||||||
|
"weight": 3
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "curiosity",
|
||||||
|
"description": "Assess the extent to which the memory reflects inquisitiveness or interest in exploring new information. A higher score reflects stronger curiosity.",
|
||||||
|
"weight": 2
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "access_frequency",
|
||||||
|
"description": "How often this memory has been accessed or surfaced recently.",
|
||||||
|
"weight": 1
|
||||||
|
}
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user