# Secure Document Agent

> Private, workspace-isolated PDF Q&A using Supabase pgvector and Gemini for secure, cited document retrieval.

Secure Document Agent is a free AI agent skill on Agensi by Rajeetvk, in LLM Ops. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Rajeetvk](https://www.agensi.io/creators/rajeetvk)
- Category: [LLM Ops](https://www.agensi.io/skills/llm-ops)
- Version: 1.0
- Last updated: 2026-11-29
- Security: scan passed (2026-11-29); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/secure-document-agent
- Tags: llm-ops, node-js, supabase, rag, pdf-analysis, gemini

## About this skill

Managing sensitive document analysis often forces a choice between data privacy and AI utility. This skill provides a self-hosted Node.js environment that processes PDFs locally and stores embeddings in your own Supabase instance, ensuring multi-tenant isolation through workspace-level filtering.

### What it does
- **Isolated RAG** provides document Q&A where vector searches are strictly scoped to specific workspace IDs.
- **Local PDF Processing** chunks and embeds documents using Gemini before syncing them to your private Supabase pgvector store.
- **Cited Responses** generates answers that include specific source document references or a clear refusal if information is missing.
- **Task Integration** allows users to create, list, and complete document-related tasks directly through the Q&A interface.
- **Webhook Delivery** supports sending summaries or findings to Discord via configured webhooks.

### How it works
1. **Infrastructure Setup** involves configuring a Supabase project with pgvector and providing a Google Gemini API key in a local `.env` file.
2. **Workspace Management** uses the CLI to create isolated buckets for different document collections, such as HR or Finance.
3. **Document Ingestion** processes local PDF files, generating embeddings that are stored with workspace-specific metadata.
4. **Natural Language Querying** executes the `ask` command to retrieve context-aware answers from the vector database.

### Frameworks & tools
Node.js 18+, Supabase (pgvector), Google Gemini (`gemini-2.5-flash-lite` and `gemini-embedding-2`), and Discord webhooks.

### Why this beats prompting it yourself
Prompting a standard LLM requires pasting sensitive data into a chat window, risking data leaks and hitting context limits. This skill automates the retrieval-augmented generation (RAG) pipeline with strict workspace isolation, ensuring your HR data never mixes with your Finance data during a search.

### Use cases
- Querying internal HR policies and benefits documents without public cloud exposure.
- Managing separate research projects where data isolation between topics is mandatory.
- Converting document findings into actionable project tasks via a unified CLI.
- Automating document summaries and broadcasting them to team Discord channels.

### Known limitations
Only PDF files are supported. Scanned, image-only PDFs will return zero chunks. Embedding speed is throttled to approximately 1.5 seconds per chunk to respect API rate limits.

## Requires

- Node.js

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Secure Document Agent skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### How does the Secure Document Agent ensure my sensitive data isn't mixed across different projects?

Unlike standard AI chats that mix your data, this skill uses workspace-level filtering in Supabase pgvector to ensure that documents from different departments, like HR and Finance, remain strictly isolated during retrieval.

### What is included in the purchase of this skill?

You will receive the full Node.js source code for the skill, the database schema for the Supabase pgvector integration, and documentation for configuring your local environment and Discord webhooks.

### Can I upload any file type for document Q&A?

The agent currently supports text-based PDF files; please note that scanned documents or image-only PDFs require OCR before they can be processed by this skill.

### Do I need to provide my own API keys or infrastructure to use this skill?

Yes, you will need a Supabase account with the pgvector extension enabled and a Google Gemini API key to handle the embeddings and natural language generation.

### Which AI agent frameworks or platforms is this skill compatible with?

The skill is built for Node.js 18+ environments and is designed to integrate with any agent framework that supports custom tool calls or CLI-based task execution.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
