{"skill":{"slug":"knowledge-vault","displayName":"knowledge-vault","summary":"Long-term RAG memory storage for your agent, powered by TiDB Vector.","description":"---\nname: knowledge-vault\ndescription: Long-term RAG memory storage for your agent, powered by TiDB Vector.\nmetadata:\n  openclaw:\n    emoji: 📚\n    requires:\n      bins: [\"python3\", \"curl\"]\n      env: [\"TIDB_HOST\", \"TIDB_PORT\", \"TIDB_USER\", \"TIDB_PASSWORD\", \"GEMINI_API_KEY\"]\n---\n\n# Knowledge Vault (Powered by TiDB Zero)\n\n## Overview\n**Knowledge Vault** is a Long-Term Memory module for AI Agents, powered by **TiDB Vector Search (RAG)**.\n\nTraditional agent memory (context window) is ephemeral and limited. Knowledge Vault allows agents to:\n1.  **Store:** Ingest documents, notes, and facts as vector embeddings.\n2.  **Retrieve:** Semantically search for relevant information based on user queries (\"RAG\").\n3.  **Remember:** Access unlimited historical context without overflowing the LLM prompt.\n\n## Why use this?\n*   **Infinite Recall:** Store millions of documents without confusing the agent.\n*   **Contextual Relevance:** Find *exact* paragraphs related to a question, not just keywords.\n*   **Privacy:** Keep your knowledge base private in your own TiDB Cloud instance.\n\n## Prerequisites\n*   **TiDB Cloud (Serverless):** With Vector Search enabled.\n*   **Embedding Model:** Requires `GEMINI_API_KEY` (or compatible).\n\n### 🔐 Security & Provisioning\nThis skill operates in two modes:\n1.  **Bring Your Own Database (Recommended):** Set `TIDB_HOST`, `TIDB_USER`, `TIDB_PASSWORD` environment variables. The skill will use your existing database.\n2.  **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.\n\n## Installation\n\n### 1. Add to `TOOLS.md`\n```markdown\n- **knowledge-vault**: Store and retrieve knowledge using vector search.\n  - **Location:** `{baseDir}/skills/knowledge_vault/SKILL.md`\n  - **Command:** `python {baseDir}/skills/knowledge_vault/run.py --action search --query \"<QUESTION>\"`\n```\n\n### 2. Add to `AGENTS.md` (Protocol)\nCopy [PROTOCOL.md](PROTOCOL.md).\n\n## Usage\n*   **Add Knowledge:**\n    ```bash\n    python {baseDir}/run.py --action add --content \"The user prefers spicy food but is allergic to peanuts.\"\n    ```\n*   **Search (RAG):**\n    ```bash\n    python {baseDir}/run.py --action search --query \"What are the user's dietary restrictions?\"\n    ```\n","tags":{"latest":"1.0.0"},"stats":{"comments":0,"downloads":246,"installsAllTime":0,"installsCurrent":0,"stars":0,"versions":2},"createdAt":1771669409167,"updatedAt":1778491597572},"latestVersion":{"version":"1.0.0","createdAt":1771684694200,"changelog":"v1.0.0: Full security compliance & env var support","license":null},"metadata":{"setup":[{"key":"TIDB_HOST","required":true},{"key":"TIDB_PORT","required":true},{"key":"TIDB_USER","required":true},{"key":"TIDB_PASSWORD","required":true},{"key":"GEMINI_API_KEY","required":true}],"os":null,"systems":null},"owner":{"handle":"lilyjazz","userId":"s175zyq9k7fh485z86hsfjxbrs83p0tz","displayName":"Lux","image":"https://avatars.githubusercontent.com/u/20071273?v=4"},"moderation":{"isSuspicious":false,"isMalwareBlocked":false,"verdict":"clean","reasonCodes":["review.llm_review"],"summary":"Review: review.llm_review","engineVersion":"v2.4.24","updatedAt":1779947132545}}