mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-25 07:00:48 +09:00
7 lines
10 KiB
JavaScript
7 lines
10 KiB
JavaScript
import{_ as t,o as i,c as a,ag as s}from"./chunks/framework.CAXxHpAX.js";const g=JSON.parse('{"title":"Built-in Memory Provider","description":"","frontmatter":{},"headers":[],"relativePath":"memory-providers/builtin.md","filePath":"memory-providers/builtin.md","lastUpdated":1774787421000}'),r={name:"memory-providers/builtin.md"};function o(n,e,d,l,h,p){return i(),a("div",null,[...e[0]||(e[0]=[s(`<h1 id="built-in-memory-provider" tabindex="-1">Built-in Memory Provider <a class="header-anchor" href="#built-in-memory-provider" aria-label="Permalink to "Built-in Memory Provider""></a></h1><p>The built-in memory provider is the standard memory backend shipped with Memoh. It works with Memoh's memory pipeline and supports:</p><ul><li>Automatic memory extraction from conversations</li><li>Semantic memory retrieval during chat</li><li>Manual memory creation and editing</li><li>Memory compaction and rebuild workflows</li></ul><p>The built-in provider operates in one of three <strong>memory modes</strong>, each with different infrastructure requirements and retrieval capabilities.</p><hr><h2 id="memory-modes" tabindex="-1">Memory Modes <a class="header-anchor" href="#memory-modes" aria-label="Permalink to "Memory Modes""></a></h2><table tabindex="0"><thead><tr><th>Mode</th><th>Index</th><th>Requirements</th><th>Use Case</th></tr></thead><tbody><tr><td><strong>Off</strong></td><td>File-based only</td><td>None</td><td>Lightweight setup, no vector search</td></tr><tr><td><strong>Sparse</strong></td><td>Neural sparse vectors</td><td>Sparse service + Qdrant (<code>--profile sparse</code>)</td><td>Good retrieval quality without embedding API costs</td></tr><tr><td><strong>Dense</strong></td><td>Dense embeddings</td><td>Embedding model + Qdrant (<code>--profile qdrant</code>)</td><td>Highest-quality semantic search</td></tr></tbody></table><h3 id="how-sparse-mode-works" tabindex="-1">How Sparse Mode Works <a class="header-anchor" href="#how-sparse-mode-works" aria-label="Permalink to "How Sparse Mode Works""></a></h3><p>Sparse mode uses the <a href="https://huggingface.co/opensearch-project/opensearch-neural-sparse-encoding-multilingual-v1" target="_blank" rel="noreferrer"><code>opensearch-neural-sparse-encoding-multilingual-v1</code></a> model (from the OpenSearch project) to convert text into sparse vectors — compact lists of token indices with importance weights. Unlike dense mode, which requires an external embedding API, the sparse model runs locally in the <code>sparse</code> container with no API key or cost. It supports multiple languages and provides significantly better retrieval quality than keyword-only search.</p><hr><h2 id="creating-a-built-in-provider" tabindex="-1">Creating a Built-in Provider <a class="header-anchor" href="#creating-a-built-in-provider" aria-label="Permalink to "Creating a Built-in Provider""></a></h2><ol><li>Navigate to the <strong>Memory Providers</strong> page.</li><li>Click <strong>Add Memory Provider</strong>.</li><li>Fill in the following fields: <ul><li><strong>Name</strong>: A display name for this provider.</li><li><strong>Provider Type</strong>: Select <code>builtin</code>.</li></ul></li><li>Click <strong>Create</strong>.</li></ol><hr><h2 id="configuring-a-built-in-provider" tabindex="-1">Configuring a Built-in Provider <a class="header-anchor" href="#configuring-a-built-in-provider" aria-label="Permalink to "Configuring a Built-in Provider""></a></h2><p>After creating a provider, select it from the list and configure its settings.</p><table tabindex="0"><thead><tr><th>Field</th><th>Description</th></tr></thead><tbody><tr><td><strong>Memory Mode</strong></td><td><code>off</code> (default), <code>sparse</code>, or <code>dense</code>. Controls how memories are indexed and retrieved.</td></tr><tr><td><strong>Embedding Model</strong></td><td>Embedding model for dense vector search. Only used in <code>dense</code> mode.</td></tr><tr><td><strong>Qdrant Collection</strong></td><td>Qdrant collection name. Defaults to <code>memory_sparse</code>.</td></tr></tbody></table><h3 id="managing-providers" tabindex="-1">Managing Providers <a class="header-anchor" href="#managing-providers" aria-label="Permalink to "Managing Providers""></a></h3><ul><li><strong>Edit</strong>: Select a provider and update its settings.</li><li><strong>Delete</strong>: Remove a provider you no longer use.</li></ul><hr><h2 id="infrastructure-requirements" tabindex="-1">Infrastructure Requirements <a class="header-anchor" href="#infrastructure-requirements" aria-label="Permalink to "Infrastructure Requirements""></a></h2><h3 id="off-mode" tabindex="-1">Off Mode <a class="header-anchor" href="#off-mode" aria-label="Permalink to "Off Mode""></a></h3><p>No additional infrastructure required. Memories are stored and retrieved using file-based indexing only.</p><h3 id="sparse-mode" tabindex="-1">Sparse Mode <a class="header-anchor" href="#sparse-mode" aria-label="Permalink to "Sparse Mode""></a></h3><p>Requires the <strong>sparse service</strong> (runs the <a href="https://huggingface.co/opensearch-project/opensearch-neural-sparse-encoding-multilingual-v1" target="_blank" rel="noreferrer"><code>opensearch-neural-sparse-encoding-multilingual-v1</code></a> model locally) and <strong>Qdrant</strong> vector database. Enable both with Docker Compose profiles:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">docker</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> compose</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --profile</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> qdrant</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --profile</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> sparse</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> up</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -d</span></span></code></pre></div><p>The following sections must be present in <code>config.toml</code>:</p><div class="language-toml vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">toml</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">qdrant</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]</span></span>
|
||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">base_url = </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"http://qdrant:6334"</span></span>
|
||
<span class="line"></span>
|
||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">sparse</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]</span></span>
|
||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">base_url = </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"http://sparse:8085"</span></span></code></pre></div><h3 id="dense-mode" tabindex="-1">Dense Mode <a class="header-anchor" href="#dense-mode" aria-label="Permalink to "Dense Mode""></a></h3><p>Requires an <strong>embedding model</strong> (configured in the provider settings) and <strong>Qdrant</strong>:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">docker</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> compose</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --profile</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> qdrant</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> up</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -d</span></span></code></pre></div><p>The Qdrant section must be present in <code>config.toml</code>:</p><div class="language-toml vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">toml</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">qdrant</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]</span></span>
|
||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">base_url = </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">"http://qdrant:6334"</span></span></code></pre></div><hr><h2 id="assigning-a-memory-provider-to-a-bot" tabindex="-1">Assigning a Memory Provider to a Bot <a class="header-anchor" href="#assigning-a-memory-provider-to-a-bot" aria-label="Permalink to "Assigning a Memory Provider to a Bot""></a></h2><ol><li>Navigate to the <strong>Bots</strong> page and open your bot.</li><li>Go to the <strong>General</strong> tab.</li><li>Find the <strong>Memory Provider</strong> dropdown.</li><li>Select the provider you created.</li><li>Click <strong>Save</strong>.</li></ol><p>If no memory provider is selected, the bot will not use that provider configuration in its runtime settings.</p><hr><h2 id="using-memory-after-setup" tabindex="-1">Using Memory After Setup <a class="header-anchor" href="#using-memory-after-setup" aria-label="Permalink to "Using Memory After Setup""></a></h2><p>Once a memory provider is assigned to the bot, you can manage actual memories from the bot's <strong>Memory</strong> tab:</p><ul><li>Create memories manually</li><li>Extract memories from conversations</li><li>Search, edit, and delete memories</li><li>Compact or rebuild the memory store</li></ul><p>For day-to-day memory operations, continue with <a href="/getting-started/memory.html">Bot Memory Management</a>.</p>`,41)])])}const m=t(r,[["render",o]]);export{g as __pageData,m as default};
|