openclaw-home-pc/vector_memory/run.sh
2026-03-24 04:00:48 +08:00

59 lines
1.8 KiB
Bash
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# 🚀 向量记忆系统 - 一键部署脚本
echo "=========================================="
echo "🧠 OpenClaw 向量记忆系统 - 快速部署"
echo "=========================================="
# 1. 安装依赖
echo ""
echo "📦 步骤 1: 安装 Python 依赖..."
if ! command -v pip3 &> /dev/null; then
echo " 需要先安装 pip请运行:"
echo " sudo apt-get update && sudo apt-get install -y python3-pip"
exit 1
fi
pip3 install chromadb openai sqlalchemy
# 2. 设置 API Key
echo ""
echo "🔑 步骤 2: 设置 API Key..."
if [ -z "$SILICONFLOW_API_KEY" ]; then
echo " 请运行以下命令(推荐写入 ~/.bashrc:"
echo ' export SILICONFLOW_API_KEY="sk-fpjdtxbxrhtekshircjhegstloxaodriekotjdyzzktyegcl"'
echo ""
echo " 或者临时运行:"
echo ' SILICONFLOW_API_KEY="sk-fpjdtxbxrhtekshircjhegstloxaodriekotjdyzzktyegcl" python3 test_memory.py'
fi
# 3. 创建目录
echo ""
echo "📁 步骤 3: 创建数据目录..."
mkdir -p ~/openclaw-memory-vector/data/memory
echo ""
echo "=========================================="
echo "✅ 部署完成!"
echo "=========================================="
echo ""
echo "📋 使用方法:"
echo ""
echo "1⃣ 测试运行:"
echo " cd ~/openclaw-memory-vector"
echo ' export SILICONFLOW_API_KEY="sk-fpjdtxbxrhtekshircjhegstloxaodriekotjdyzzktyegcl"'
echo " python3 test_memory.py"
echo ""
echo "2⃣ 添加记忆:"
echo ' python3 memory_cli.py add "今天学习了向量数据库" --importance 4 --tags 学习'
echo ""
echo "3⃣ 搜索记忆:"
echo ' python3 memory_cli.py search "股票"'
echo ""
echo "4⃣ 查看最近:"
echo " python3 memory_cli.py recent"
echo ""
echo "5⃣ 统计数量:"
echo " python3 memory_cli.py count"
echo ""