File Search Assistant with LLM Integration

by Code-Trees

226 downloads
Not rated
GitHub

About

Learn how to: ✅ Build a file-search AI using natural language queries ✅ Create embeddings from local Linux files using Hugging Face models ✅ Integrate Gemini API (Google AI Studio) into your local apps ✅ Use MCP to control multiple agents with server-client architecture ✅ Apply c

Details

Author
Code-Trees
Downloads
226
Categories
Search

- Natural language file search queries
- Semantic search using BERT embeddings
- Gemini LLM integration for query understanding
- Automatic file extension inference
- MCP server for file system operations
- Extensible architecture

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name File Search Assistant with LLM Integration
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Install Python 3.8+ and dependencies (pip install -r requirements.txt), set the GEMINI_API_KEY in a .env file, then run python main.py. Enter a natural‑language query when prompted; the system extracts a filename via the LLM, performs semantic search, and displays matching file locations.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "file search assistant with llm integration": {
            "Agentic_search": {
                "command": "python",
                "args": [
                    "main.py"
                ]
            }
        }
    }
}

McpServers

{
    "Agentic_search": {
        "command": "python",
        "args": [
            "main.py"
        ]
    }
}

File Search Assistant with LLM Integration

This project combines semantic search capabilities with Large Language Models (LLM) to provide intelligent file search functionality in Linux systems.

Features

- Natural language file search queries
- Semantic search using BERT embeddings
- File system integration with MCP server
- Gemini LLM integration for query understanding
- Automatic file extension inference

Prerequisites

- Python 3.8 or higher
- CUDA-compatible GPU (optional, for faster processing)
- Linux operating system

Installation

1. Clone the repository:

git clone <repository-url>
cd LLm_To_agent/data_dir

2. Install dependencies:

pip install -r requirements.txt

3. Configure environment variables:
- Create a .env file in the project root
- Add your Gemini API key:

   GEMINI_API_KEY="your-api-key-here"

Project Structure

data_dir/
├── main.py              # Main application entry point
├── tools/
│   └── file_finder.py   # File search implementation
├── utils/
│   └── doc_Search.py    # Document search utilities
├── llm/
│   └── gemini_client.py # LLM integration
├── .env                 # Environment variables
└── OSData_store.pth     # Embedded data storage

Usage

1. Start the application:

python main.py

2. Enter your search query when prompted:

What file are you looking for?
> "find a python script that handles file operations"

3. The system will:
- Extract the relevant filename using LLM
- Search the file system using semantic search
- Display matching file locations

Features in Detail

- LLM Integration: Uses Google's Gemini for natural language understanding
- Semantic Search: Employs BERT embeddings for context-aware file matching
- MCP Server: Handles file system operations efficiently
- Extensible Architecture: Easy to add new search capabilities

Troubleshooting

If you encounter the error "Embeddings file not found", run:

cd ~ && find / -type f 2>/dev/null >> Desktop/LLm_To_agent

License

[Your chosen license]

Contributing

[Your contribution guidelines]

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.