/install filechat-rag
FileChat RAG Skill
Your personal RAG (Retrieval-Augmented Generation) document library backed by Google Drive. Supports multiple Google Drive folders dynamically, interactive folder routing, incremental sync, choosing between Gemini or OpenAI for embeddings, and connecting to Qdrant.
Setup & Bootstrap
FIRST verify that the required environment variables are set in /workspace/skills/filechat/.env:
EMBEDDING_PROVIDER(eithergeminioropenai)GEMINI_API_KEYorOPENAI_API_KEY- Optional:
QDRANT_URLandQDRANT_API_KEY(If absent, it uses local disk-based JSON).
Create the .env file like this:
echo "EMBEDDING_PROVIDER=gemini" > ./skills/filechat/.env
echo "GEMINI_API_KEY=your_key_here" >> ./skills/filechat/.env
Google Workspace Authentication: Before running any commands, check if the system is authenticated by running:
npx @googleworkspace/cli auth status
If it returns an auth error or indicates no token, you MUST prompt the user to authenticate. Trigger the interactive login flow:
npx @googleworkspace/cli auth login --services drive
Wait for the user to complete the browser OAuth flow before proceeding.
Folder Management
The user can have infinite folders synced. You manage them using folders.js.
- List Folders:
cd ./skills/filechat && node folders.js list - Add a Folder:
node folders.js add "Taxes 2026" \x3CFOLDER_ID>(Auto-discovers the ID viagws drive files listif you don't know it!) - Set Default Folder:
node folders.js default "Taxes 2026"
If the user asks to do something with a file/folder but doesn't specify which one, run node folders.js get-default to find the default ID. If no folders exist, ask them to set one up!
How to Sync the Library
When the user asks to "sync", "flush", or "update", you must run the ingestion script.
To sync a specific folder:
cd ./skills/filechat && node sync.js \x3CFOLDER_ID>
To sync EVERYTHING (all folders in the registry):
cd ./skills/filechat && node sync-all.js
Note: Syncs are highly incremental and use a local cache! If a file hasn't been modified in Drive, the script will skip it instantly and output "0 chunks" embedded. This is NORMAL behavior. If you are debugging, testing, or the user specifically requests a hard flush, you MUST delete the cache files first:
rm ./skills/filechat/meta_\x3CFOLDER_ID>.json
rm ./skills/filechat/vector_db_\x3CFOLDER_ID>.json
How to Answer User Questions (RAG)
Query the local vector store or Qdrant for the target Folder ID to fetch relevant text chunks:
cd ./skills/filechat && node query.js \x3CFOLDER_ID> "What does my medical discharge say?"
Use the snippets returned to answer the user.
How to Retrieve and Send a Physical File
Find the File ID using the query script, then download it:
gws drive files get --params '{"fileId": "\x3CFILE_ID>", "alt": "media"}' --output /workspace/discharge.pdf
Reply using the media tag: MEDIA:/workspace/discharge.pdf.
How to Store a New File for the User
If the user uploads a file and asks you to save it (or implicitly sends a file per your automatic processing rules):
- Check their folders (
node folders.js list). - If they didn't specify which folder, use the default folder. If no default is set, ask them!
- Notify the user exactly which folder the file is being saved to.
- Tell the user that you are now extracting the information and saving it in a vectordb.
- If the file is an image or scanned document, make sure to extract the text using a vision model or OCR before it is embedded. (The sync script handles this natively).
- Upload it to the correct folder using
gws:gws drive files create --json '{"name": "filename.pdf", "parents": ["\x3CFOLDER_ID>"]}' --upload /path/to/uploaded/file.pdf - Trigger
node sync.js \x3CFOLDER_ID>so the vector database chunks and embeds the file into the corresponding vectordb.
How to Test & Validate the Skill
If the user asks you to verify the skill is working, or if you just set it up and want to ensure end-to-end functionality, follow these exact steps:
- Verify Auth: Run
npx @googleworkspace/cli auth status. Ensure it shows a valid token. - Verify Drive Access: Do a dry-run fetch of the target folder to ensure GWS can see the files.
(If this fails, check folder permissions or GWS credentials.)npx @googleworkspace/cli drive files list --params '{"q": "'\''\x3CFOLDER_ID>'\'' in parents and trashed = false"}' - Force a Clean Sync: Clear the cache for the test folder to guarantee a fresh run, then sync.
(You should see files being downloaded, OCR'd, and chunks being embedded. If it says "0 chunks", verify the folder isn't empty.)rm -f ./skills/filechat/meta_\x3CFOLDER_ID>.json ./skills/filechat/vector_db_\x3CFOLDER_ID>.json node ./skills/filechat/sync.js \x3CFOLDER_ID> - Test the Vector Query: Run a generic query to verify the embeddings were saved and cosine similarity works.
(You should see a list of "Top matches" with similarity scores and text snippets. If you do, the RAG pipeline is 100% operational!)node ./skills/filechat/query.js \x3CFOLDER_ID> "hello"
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install filechat-rag - 安装完成后,直接呼叫该 Skill 的名称或使用
/filechat-rag触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Filechat 是什么?
Search, retrieve, and chat with documents securely stored in ANY Google Drive folder using semantic vector search (RAG). Use when: (1) a user asks to save a... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 178 次。
如何安装 Filechat?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install filechat-rag」即可一键安装,无需额外配置。
Filechat 是免费的吗?
是的,Filechat 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Filechat 支持哪些平台?
Filechat 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Filechat?
由 eladrave(@eladrave)开发并维护,当前版本 v1.0.4。