File Search SaaS
A powerful, AI-driven document search and management system powered by Google Gemini API and MongoDB.
Features
- Smart Document Management: Upload and organize files into libraries (Project-based isolation).
- Semantic Search (RAG): Ask questions about your documents using Google's Gemini models with Grounding.
- Vector Store Integration: Automatically handles storage and vectorization of files via Google Cloud.
- Interactive Playground: A built-in sandbox to experiment with Google File APIs directly from the browser.
- Duplicate Detection: Smart hashing to prevent duplicate file uploads.
- Internationalization: Fully localized UI (English & Farsi) with RTL support.
Tech Stack
- Framework: Next.js 15 (App Router)
- Database: MongoDB (Mongoose ODM)
- AI Engine: Google Gemini API (
@google/genai) - Styling: Tailwind CSS + Shadcn/Radix UI
Core Concepts
1. Libraries vs. Stores
Vector Store: The underlying Google Cloud resource that holds vector embeddings of your files. Each user has one primary store.
Library: A logical grouping of files within the application. This helps you organize files on the UI side, even though they live in the same Vector Store.
2. Scoped Search
You can control the context of your AI chats:
- Global Chat: Searches across all your uploaded files.
- Library Chat: Restricts the search context to files within a specific Library.
- File Chat: "Talk" to a single file. The AI only sees that specific document.
3. Search Modes
Located in the Chat Settings, you can tune the AI's behavior:
- Limited Mode (Strict): The AI relies heavily on your documents. If the answer isn't in the files, it will say "I don't know". Good for contracts/facts.
- Auxiliary Mode (Creative): The AI uses your documents as inspiration but can draw from its general knowledge. Good for brainstorming or creative writing.
Getting Started
To run this project locally, clone the repository, setup your environment variables (MongoDB URI and Google API Key), install dependencies via npm install, and start the development server with npm run dev.