Personal Memory Skill
基于本地大模型的个人电脑文件检索与问答。数据与模型全程在本机,不联网、不上传。
Usage(唯一入口:run.ps1)
在项目根目录打开 PowerShell 执行(服务需先 start 一次):
| 命令 | 说明 | 示例 |
|------|------|------|
| run.ps1 start | 启动常驻服务(named-pipe),模型常驻内存 | .\\run.ps1 start |
| run.ps1 ask "<问题>" | 本地大模型 RAG 问答(检索→生成) | .\\run.ps1 ask "鱼香肉丝怎么做" |
| run.ps1 query "<问题>" | 语义检索,返回文件+片段+分数 | .\\run.ps1 query "机器学习资料" |
| run.ps1 understand "<文件>" | 单文件理解:摘要+片段 | .\\run.ps1 understand "D:\\笔记.md" |
| run.ps1 index "<目录>" | 建立索引 | .\\run.ps1 index "D:\\我的文档" |
| run.ps1 status | 查看服务状态 | .\\run.ps1 status |
| run.ps1 shutdown | 停止服务 | .\\run.ps1 shutdown |
输出解读
ask:返回answer(本地大模型生成)+evidence(引用文件/片段)与backend(推理后端)。query:results[]按文件聚合,含source/file、文本片段与匹配分数。status:ready表示模型是否已加载。
错误处理
- “管道不存在:服务未启动” → 先执行
run.ps1 start。 - “未找到本地模型” → 按提示从魔搭下载 GGUF 至
~\\models\\。 - 单次请求失败不影响服务,响应中携带
error字段。
Important
- 不要绕过 run.ps1 直接调用 client.py/server.py,入口脚本统一版本与参数。
- 首跑需要下载并加载模型:大模型约 3GB 磁盘(首次联网从魔搭下载),模型加载约 30-60 秒,之后常驻响应秒级。
- Windows only:named-pipe 依赖 Win32;不支持 Linux/macOS 此入口。
- 无云端回退:所有能力本地完成,绝不把用户文件发给任何云端服务。
微信扫一扫