← Back to Skills Marketplace
eladrave

Filechat

by eladrave · GitHub ↗ · v1.0.4 · MIT-0
cross-platform ⚠ suspicious
178
Downloads
0
Stars
0
Active Installs
5
Versions
Install in OpenClaw
/install filechat-rag
Description
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...
README (SKILL.md)

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:

  1. EMBEDDING_PROVIDER (either gemini or openai)
  2. GEMINI_API_KEY or OPENAI_API_KEY
  3. Optional: QDRANT_URL and QDRANT_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 via gws drive files list if 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):

  1. Check their folders (node folders.js list).
  2. If they didn't specify which folder, use the default folder. If no default is set, ask them!
  3. Notify the user exactly which folder the file is being saved to.
  4. Tell the user that you are now extracting the information and saving it in a vectordb.
  5. 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).
  6. 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
    
  7. 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:

  1. Verify Auth: Run npx @googleworkspace/cli auth status. Ensure it shows a valid token.
  2. Verify Drive Access: Do a dry-run fetch of the target folder to ensure GWS can see the files.
    npx @googleworkspace/cli drive files list --params '{"q": "'\''\x3CFOLDER_ID>'\'' in parents and trashed = false"}'
    
    (If this fails, check folder permissions or GWS credentials.)
  3. Force a Clean Sync: Clear the cache for the test folder to guarantee a fresh run, then sync.
    rm -f ./skills/filechat/meta_\x3CFOLDER_ID>.json ./skills/filechat/vector_db_\x3CFOLDER_ID>.json
    node ./skills/filechat/sync.js \x3CFOLDER_ID>
    
    (You should see files being downloaded, OCR'd, and chunks being embedded. If it says "0 chunks", verify the folder isn't empty.)
  4. Test the Vector Query: Run a generic query to verify the embeddings were saved and cosine similarity works.
    node ./skills/filechat/query.js \x3CFOLDER_ID> "hello"
    
    (You should see a list of "Top matches" with similarity scores and text snippets. If you do, the RAG pipeline is 100% operational!)
Usage Guidance
What to consider before installing: - Functionally coherent but metadata is misleading: the registry does not list the environment variables you must provide. The skill needs EMBEDDING_PROVIDER and one of GEMINI_API_KEY or OPENAI_API_KEY (and optionally QDRANT_URL / QDRANT_API_KEY) in ./skills/filechat/.env. - Sensitive credentials appear inside the repo's tests: tests/credentials.json contains a Google OAuth client_secret and tests reference a hard-coded GEMINI API key. Do NOT use those credentials for your account. Treat them as a red flag — they may be stale/test values, or they could be live; avoid trusting them and do not rely on embedded secrets. - The skill runs the Google Workspace CLI interactively (it will prompt you to authenticate and will request Drive access). Only point it at folders/accounts you trust. It will download files from any Drive folder you authorize and can upload files into Drive folders you choose. - Installation runs npm install and will install multiple dependencies; review package.json and package-lock if you require stricter supply-chain assurance. Run in an isolated environment (container or dedicated VM) if you decide to test it. - If you proceed: remove or replace the test credentials, supply your own API keys, and verify Qdrant endpoint ownership before pointing the skill at sensitive data. Consider restricting the skill to a dedicated Google account or a folder with limited data. - If you want a safer baseline: request the publisher to (1) update registry metadata to declare required env vars, (2) remove hard-coded credentials from the repository, and (3) publish documentation about the expected auth model and data residency for Qdrant.
Capability Analysis
Type: OpenClaw Skill Name: filechat-rag Version: 1.0.4 The skill bundle contains hardcoded sensitive credentials, specifically a Google OAuth client_secret in 'tests/credentials.json' and a Gemini API key ('AIzaSyAOx5NDLxsyRjd0qWT33LXZ_KKwMtyzOe4') within 'tests/setup.js' and 'tests/skill.test.js'. While the core logic in 'sync.js' and 'query.js' aligns with the stated RAG purpose, the use of 'execSync' to call the Google Workspace CLI with partially sanitized inputs poses a risk of command injection. The presence of functional secrets in a distributed bundle is a critical security flaw, though there is no explicit evidence of data exfiltration logic.
Capability Assessment
Purpose & Capability
The skill's stated purpose (indexing Google Drive, embedding with Gemini/OpenAI, storing vectors locally or in Qdrant) matches the required binaries (node, npm, gws) and the code. However the registry metadata declares no required environment variables while SKILL.md and the code clearly require EMBEDDING_PROVIDER plus GEMINI_API_KEY or OPENAI_API_KEY (and optionally QDRANT_URL/QDRANT_API_KEY). This metadata omission is misleading and incoherent.
Instruction Scope
Runtime instructions are explicit about running the Google Workspace CLI, performing an interactive OAuth login, reading/writing a .env inside ./skills/filechat, downloading/uploading files from Drive, and deleting cache files. These actions are within the stated purpose. However the repository also contains test artifacts that perform interactive authentication and include a hard-coded GEMINI API key and OAuth client credentials; those test-related instructions and files increase risk and are unexpected for a production skill.
Install Mechanism
Install uses npm to install @googleworkspace/cli (which exposes gws) and runs npm install for the skill. This is a standard, traceable npm install (no arbitrary URL downloads or extracted archives). The dependency list is broad (embedding, qdrant, pdf parsing, etc.) but consistent with the feature set.
Credentials
The code requires embedding provider credentials (GEMINI_API_KEY or OPENAI_API_KEY) and optionally Qdrant credentials, which are reasonable for the feature set — but the registry did not declare these env vars. Critically, the repo contains test files with hard-coded credentials: a Google OAuth client_id/client_secret and a GEMINI_API_KEY-like string. These embedded secrets are unnecessary for end users and are a sensitive, unexpected inclusion.
Persistence & Privilege
The skill does not request always:true and does not modify other skills or global agent config. It stores vector DB and meta files under its own directory and writes downloaded files to workspace paths; that behavior is expected for this functionality.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install filechat-rag
  3. After installation, invoke the skill by name or use /filechat-rag
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.4
- Added developer tests and setup files for validation and automated testing (`tests/credentials.json`, `tests/setup.js`, `tests/skill.test.js`). - Added `_meta.json` to support additional skill metadata or configuration. - Removed an obsolete or auto-generated metadata file. - Updated documentation with a new section on Google Workspace authentication, including how to check and prompt for Drive OAuth before usage. - Expanded documentation with a full end-to-end testing and validation workflow for setup, authentication, cache cleaning, and RAG functionality.
v1.0.3
- Improved file upload flow: now requires notifying the user which folder their file is being saved to and confirming vector extraction. - Clarified that, for new files, if no folder is specified, the default is used—otherwise, ask the user to select. - Added explicit instruction to inform the user when extraction to the vectordb begins. - Stated that images and scanned documents must be processed with OCR or a vision model before embedding (handled natively by the sync script). - Updated sequential steps for storing new files, emphasizing clearer user communication.
v1.0.2
V3 Update: Added folders.json registry, incremental sync caching, multi-folder interactive routing, OpenAI embedding support, and daily cron job capabilities.
v1.0.1
V3 Update: Added folders.json registry, incremental sync caching, multi-folder interactive routing, OpenAI embedding support, and daily cron job capabilities.
v1.0.0
Initial release
Metadata
Slug filechat-rag
Version 1.0.4
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 5
Frequently Asked Questions

What is 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... It is an AI Agent Skill for Claude Code / OpenClaw, with 178 downloads so far.

How do I install Filechat?

Run "/install filechat-rag" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Filechat free?

Yes, Filechat is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Filechat support?

Filechat is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Filechat?

It is built and maintained by eladrave (@eladrave); the current version is v1.0.4.

💬 Comments