---
name: knowledge-vault-fcfb03151fe1
description: Long-term RAG memory storage for your agent, powered by TiDB Vector.
metadata:
  openclaw:
    emoji: 📚
    requires:
      bins: ["python3", "curl"]
      env: ["TIDB_HOST", "TIDB_PORT", "TIDB_USER", "TIDB_PASSWORD", "GEMINI_API_KEY"]
---

# Knowledge Vault (Powered by TiDB Zero)

## Overview
**Knowledge Vault** is a Long-Term Memory module for AI Agents, powered by **TiDB Vector Search (RAG)**.

Traditional agent memory (context window) is ephemeral and limited. Knowledge Vault allows agents to:
1.  **Store:** Ingest documents, notes, and facts as vector embeddings.
2.  **Retrieve:** Semantically search for relevant information based on user queries ("RAG").
3.  **Remember:** Access unlimited historical context without overflowing the LLM prompt.

## Why use this?
*   **Infinite Recall:** Store millions of documents without confusing the agent.
*   **Contextual Relevance:** Find *exact* paragraphs related to a question, not just keywords.
*   **Privacy:** Keep your knowledge base private in your own TiDB Cloud instance.

## Prerequisites
*   **TiDB Cloud (Serverless):** With Vector Search enabled.
*   **Embedding Model:** Requires `GEMINI_API_KEY` (or compatible).

### 🔐 Security & Provisioning
This skill operates in two modes:
1.  **Bring Your Own Database (Recommended):** Set `TIDB_HOST`, `TIDB_USER`, `TIDB_PASSWORD` environment variables. The skill will use your existing database.
2.  **Auto-Provisioning (Fallback):** If no credentials are found, the skill calls the **TiDB Zero API** to create a temporary, ephemeral database for you. It caches the connection string locally (`~/.openclaw_knowledge_vault_dsn`) to persist memory across runs.

## Installation

### 1. Add to `TOOLS.md`
```markdown
- **knowledge-vault**: Store and retrieve knowledge using vector search.
  - **Location:** `{baseDir}/skills/knowledge_vault/SKILL.md`
  - **Command:** `python {baseDir}/skills/knowledge_vault/run.py --action search --query "<QUESTION>"`
```

### 2. Add to `AGENTS.md` (Protocol)
Copy [PROTOCOL.md](PROTOCOL.md).

## Usage
*   **Add Knowledge:**
    ```bash
    python {baseDir}/run.py --action add --content "The user prefers spicy food but is allergic to peanuts."
    ```
*   **Search (RAG):**
    ```bash
    python {baseDir}/run.py --action search --query "What are the user's dietary restrictions?"
    ```


---
Source attribution: modbender
Original project: https://github.com/modbender/skill-library-mcp/blob/d9c8fe903b5b4e82237dbe8d0df8567783022e18/data/knowledge-vault/SKILL.md
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Dave AI.

## Upstream license notice

MIT License

Copyright (c) 2025 skill-library-mcp contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Dave AI resource metadata

Creator / publisher: modbender
Original project: https://github.com/modbender/skill-library-mcp/blob/d9c8fe903b5b4e82237dbe8d0df8567783022e18/data/knowledge-vault/SKILL.md
Attribution basis: Source repository record

Fields of work: Development & Engineering, Product Management
Roles: Data Engineer, ML / AI Engineer, Product Manager
Specialties: API, Database
Tools: Gemini Api, Tidb
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: cf7d8bfd8c5180e4fbcc14bf9af082ef4bd886bc1a58a27c1719b7faff3ffc28
