# How to Configure the Recall Strategy in TencentDB Agent Memory

> Learn how to configure the recall strategy in TencentDB Agent Memory. Easily set embedding, keyword, or hybrid recall via JSON configuration and reload the gateway for instant updates.

- Repository: [Tencent Cloud/TencentDB-Agent-Memory](https://github.com/TencentCloud/TencentDB-Agent-Memory)
- Tags: how-to-guide
- Published: 2026-08-30

---

**Configure the recall strategy in TencentDB Agent Memory by setting the `recall.strategy` field to `"embedding"`, `"keyword"`, or `"hybrid"` in the `memory-tencentdb` JSON configuration, then reload the gateway or restart the plugin to apply changes.**

The recall step determines how your agent retrieves relevant memories during each conversational turn. According to the TencentDB-Agent-Memory source code, this behavior is controlled through a structured configuration object defined in the plugin schema and processed by the `performRecall` hook. Understanding these configuration options allows you to optimize retrieval for vector similarity, keyword matching, or a fusion of both approaches.

## Recall Configuration Schema

The recall behavior is configured within the `memory-tencentdb` section of your agent settings. As documented in [`MemoryCore/SKILL.md`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/MemoryCore/SKILL.md), the recall block accepts four key fields that control retrieval behavior:

| Field | Description | Example Values |
|-------|-------------|----------------|
| `recall.enabled` | Toggles the recall functionality on or off. | `true`, `false` |
| `recall.maxResults` | Maximum L1 memories injected into the prompt per turn. | `5`, `10` |
| `recall.scoreThreshold` | Minimum relevance score required for memory inclusion. | `0.3`, `0.5` |
| `recall.strategy` | Search algorithm used to fetch memories. | `"embedding"`, `"keyword"`, `"hybrid"` |

The `recall.strategy` field is defined as a string enum in [`MemoryCore/openclaw.plugin.json`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/MemoryCore/openclaw.plugin.json) (line 91), restricting values to the three supported search methods. This schema validation ensures that only valid strategies are passed to the `performRecall` hook.

## Available Recall Strategies

TencentDB Agent Memory supports three distinct retrieval strategies, each suited to different data characteristics and latency requirements.

### Embedding Strategy

Set `"strategy": "embedding"` to enable **vector-based retrieval**. This approach uses embeddings to find semantically similar memories based on cosine similarity or distance metrics in vector space. Use this strategy when you need conceptual understanding beyond literal keyword matches.

### Keyword Strategy

Set `"strategy": "keyword"` to force **pure BM25 keyword matching**. This method relies on traditional text indexing and is ideal when you require exact term matching or when working with highly structured data where specific terminology matters more than semantic meaning.

### Hybrid Strategy (Default)

Set `"strategy": "hybrid"` (the default) to utilize **Reciprocal Rank Fusion (RRF)**. This combines both embedding and keyword results, re-ranking them to provide the most comprehensive retrieval. According to the implementation in [`MemoryCore/openclaw-plugin/src/hooks/recall.ts`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/MemoryCore/openclaw-plugin/src/hooks/recall.ts), this strategy provides the best of both semantic understanding and precise term matching.

## How the Recall Hook Processes Configuration

When recall is triggered, the `performRecall` hook in [`MemoryCore/openclaw-plugin/src/hooks/recall.ts`](https://github.com/TencentCloud/TencentDB-Agent-Memory/blob/main/MemoryCore/openclaw-plugin/src/hooks/recall.ts) (lines 30-55) executes the configured strategy through