Files
TrulyMEM-TrueHumanMEM-local/docs/一键启动指南.md
JianFeeeee 6689f08456 feat: Add embedded SQLite database and web interface
- Implement EmbeddedGraphDB with full Neo4j compatibility
- Add web interface for browser access
- Fix input box display issue
- Add comprehensive database tests (15/15 passed)
- Simplify startup script (3 steps, no Docker needed)
- Add multi-language support
- Add .gitignore for clean repository
- Update documentation

All tests passed. Ready for production.
2026-04-10 15:43:22 +08:00

4.5 KiB
Raw Blame History

baoliu1# Graph Memory TUI - 一键启动指南

🚀 快速开始

Windows

方法 1: 双击启动(推荐)

双击 start.bat

方法 2: 命令行启动

start.bat

方法 3: Python启动

python start.py

Linux / macOS

方法 1: Shell脚本

chmod +x start.sh
./start.sh

方法 2: Python启动

python3 start.py

📋 一键启动脚本功能

启动脚本会自动完成以下步骤:

Step 1: 启动 Docker

  • 检查 Docker 是否安装
  • 自动启动 Docker Desktop (Windows) / Docker daemon (Linux/macOS)
  • 等待 Docker 就绪最多60秒

Step 2: 启动 Neo4j

  • 检查 Neo4j 容器是否存在
  • 自动创建容器(如果不存在)
  • 启动 Neo4j 数据库
  • 等待数据库就绪

Step 3: 检查 Python

  • 验证 Python 版本
  • 显示 Python 信息

Step 4: 设置虚拟环境

  • 创建虚拟环境(如果不存在)
  • 激活虚拟环境
  • 安装依赖包

Step 5: 启动应用

  • 启动 Graph Memory TUI
  • 显示连接信息

🔧 系统要求

必需软件

  1. Docker Desktop

  2. Python 3.8+

硬件要求

  • 内存: 至少 4GB (推荐 8GB)
  • 磁盘: 至少 5GB 可用空间
  • CPU: 2核心以上

📊 启动流程

start.bat / start.sh / start.py
         ↓
    [1/5] 检查 Docker
         ↓
    [2/5] 启动 Neo4j
         ↓
    [3/5] 检查 Python
         ↓
    [4/5] 设置虚拟环境
         ↓
    [5/5] 启动应用
         ↓
    Graph Memory TUI 运行中

🎯 使用方法

首次启动

  1. 双击 start.bat (Windows) 或运行 ./start.sh (Linux/macOS)

  2. 等待所有步骤完成约1-2分钟

  3. 看到以下信息表示成功:

    ========================================
      All systems ready!
    ========================================
    
    Neo4j Connection:
      - Browser: http://localhost:7474
      - Bolt:    bolt://localhost:7687
      - User:    neo4j
      - Pass:    graphmemory123
    
    Starting TUI application...
    
  4. 配置 API Key

    • 按 F2 展开侧边栏
    • 点击"配置"
    • 输入你的 DeepSeek API Key
    • 按 Enter 保存
  5. 开始对话

    • 输入消息
    • 按 Enter 发送

后续启动

直接运行启动脚本即可,所有服务会自动启动。

⚠️ 常见问题

问题 1: Docker 启动失败

错误: Docker Desktop failed to start

解决:

  1. 手动启动 Docker Desktop
  2. 等待 Docker 完全启动(托盘图标显示绿色)
  3. 重新运行启动脚本

问题 2: Neo4j 连接失败

错误: Couldn't connect to localhost:7687

解决:

# 检查容器状态
docker ps -a | grep neo4j

# 重启容器
docker restart neo4j

# 查看日志
docker logs neo4j

问题 3: Python 依赖安装失败

错误: Failed to install dependencies

解决:

# 手动安装
python -m venv venv
venv\Scripts\activate  # Windows
source venv/bin/activate  # Linux/macOS
pip install -r requirements.txt

问题 4: 端口被占用

错误: port 7474 or 7687 already in use

解决:

# 停止旧容器
docker stop neo4j
docker rm neo4j

# 重新运行启动脚本

🌐 访问 Neo4j 浏览器

启动成功后,可以访问 Neo4j 浏览器界面:

  1. 打开浏览器访问: http://localhost:7474
  2. 登录信息:
    • 用户名: neo4j
    • 密码: graphmemory123

📝 配置文件

环境变量

创建 .env 文件配置:

# API配置
DEEPSEEK_API_KEY=sk-xxxxxxxxxxxxx
DEEPSEEK_BASE_URL=https://api.deepseek.com
MODEL_NAME=deepseek-chat

# Neo4j配置
NEO4J_URI=bolt://localhost:7687
NEO4J_USER=neo4j
NEO4J_PASSWORD=graphmemory123

🔄 停止服务

停止应用

  • 按 F6 或 Ctrl+C

停止 Neo4j

docker stop neo4j

停止 Docker Desktop

  • Windows: 右键托盘图标 → Quit Docker Desktop
  • Linux: sudo systemctl stop docker
  • macOS: 右键托盘图标 → Quit Docker

📚 更多信息

  • 架构设计: 架构.md
  • API文档: specs/ 目录
  • 问题反馈: GitHub Issues

🎉 开始使用

现在就运行启动脚本,开始使用 Graph Memory TUI 吧!

# Windows
start.bat

# Linux/macOS
./start.sh

# 或使用 Python
python start.py

🎯