{
  "markdown": "# Vertex AI RAG Engine Extension for Gemini CLI\n\nCredits:- Mandeep Singh Bawa, Shlok Karpathak\n\n## Overview\nThe **Vertex AI RAG Engine Extension** allows the Gemini CLI to interact with the Google Cloud Vertex AI Retrieval-Augmented Generation (RAG) Engine. With this extension, you can manage document corpus, import files, and retrieve context for answering questions based on your uploaded documents.\n\n## Prerequisites\n-   **Node.js**: v18+ \n-   **Gemini CLI**: Installed and configured.\n-   **Google Cloud Project**: A GCP project with Vertex AI API enabled.\n-   **Authentication**: Local credentials set up (e.g., Application Default Credentials).\n\n## Installation\n\nTo install or link the extension for local development:\n\n1.  Navigate to the extension directory.\n2.  Build the project:\n    ```bash\n    npm run build\n    ```\n3.  Link the extension to the Gemini CLI:\n    ```bash\n    gemini extensions link .\n    ```\n    *During installation, you will be prompted to configure settings like Project ID.*\n\n*Note: If you get an error that the extension is already installed, run `gemini extensions uninstall vertex-ai-rag-extension` first.*\n\n## Configuration\n\nThe extension supports the following settings, which can be configured during installation or via the CLI:\n\n| Setting Name | Environment Variable | Description | Default |\n| :--- | :--- | :--- | :--- |\n| **Project ID** | `PROJECT_ID` | Google Cloud Project ID for Vertex AI requests. | *Required* |\n| **Location** | `LOCATION` | Google Cloud location/region (e.g., `us-central1`). | `us-central1` |\n| **Enable Disruptive Actions** | `ENABLE_DISRUPTIVE_ACTIONS` | Set to `true` to enable `delete` tools. | `false` |\n\nTo change configuration:\n```bash\ngemini extensions config vertex-ai-rag-extension\n```\n\n## Capabilities & Tools\n\n### Corpus Management\n*   **`list_rag_corpus`**: Lists all RAG Corpus.\n    *   *Params*: `page_size` (max items), `page_token` (pagination token).\n*   **`get_rag_corpus`**: Gets details of a specific corpus.\n    *   *Params*: `rag_corpus_id` (required).\n*   **`create_rag_corpus`**: Creates a new RAG Corpus.\n    *   *Params*: `display_name` (required), `description`.\n*   **`delete_rag_corpus`**: Deletes a corpus.\n    *   *Safety*: Requires `Enable Disruptive Actions` to be true.\n    *   *Params*: `rag_corpus_id` (required).\n\n### File Management\n*   **`list_rag_files`**: Lists files in a corpus.\n    *   *Params*: `rag_corpus_id` (required).\n*   **`get_rag_file`**: Gets file details.\n    *   *Params*: `rag_corpus_id` (required), `rag_file_id` (required).\n*   **`import_rag_files`**: Imports files from GCS or Google Drive (Returns Operation).\n    *   *Params*: `rag_corpus_id` (required), `import_config` (GCS or Drive Source).\n*   **`delete_rag_file`**: Deletes a file.\n    *   *Safety*: Requires `Enable Disruptive Actions` to be true.\n    *   *Params*: `rag_corpus_id` (required), `rag_file_id` (required).\n\n### Retrieval (Core)\n*   **`retrieve_contexts`**: Retrieves relevant text snippets based on a query.\n    *   *Params*:\n        *   `rag_corpus_id` (required): Target corpus.\n        *   `query_text` (required): Query text.\n        *   `similarity_top_k`: Max snippets retrieved.\n        *   `vector_distance_threshold`: Similarity threshold.\n\n## Testing\n\nAn isolated integration test script is included to test the MCP server capabilities directly against the Vertex AI API without the CLI wrapper.\n\nTo run the integration tests:\n\n1. Ensure you have authenticated your Google Cloud CLI:\n    ```bash\n    gcloud auth application-default login\n    ```\n2. Run the test script:\n    ```bash\n    npm run test:integration\n    ```\n\nThis will run through a complete testing lifecycle including listing, creating, getting, and attempting to delete a RAG corpus to verify permissions, configuration, and API connectivity.\n\n## Usage with Gemini CLI\n\nOnce installed and configured, the tools are available to the Gemini CLI models. You can ask the CLI to use the extension directly in prompts:\n\n```bash\n# Example: Using retrieval tool for context\ngemini \"Use vertex-ai-rag-extension to list all corpus\"\n\n# Example: Ask questions using an existing Corpus ID\ngemini \"Ask my corpus '123456789' what the safety policy is\"\n```\n\nThe model will automatically invoke the relevant sub-tools (like `retrieve_contexts`) as needed to fulfill the request.\n",
  "bytes": 4337,
  "sha": "1807d6c24335013cdf40767363bba7207c8c46f95f3cec3599948b9f34feb790",
  "repo_slug": "skpathak2/vertex-ai-rag-engine-extension",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_skpathak2_vertex_ai_rag_engine_extension_906d97a7/readme"
}