Skip to content

arsath-eng/rag-agent-adk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vertex AI RAG Agent

This project implements a Retrieval Augmented Generation (RAG) agent using Google Cloud Vertex AI and the Agent Development Kit (ADK). The agent can manage document corpora (create, list, delete) and answer questions based on the uploaded documents.

Features

  • Query Documents: Answer questions using information retrieved from document corpora.
  • Manage Corpora: Create, list, and delete document corpora.
  • Manage Documents: Add files (Google Drive, GCS) to corpora and delete specific documents.
  • Vertex AI Integration: Built on top of Google's Gemini models and Vertex AI Vector Search.

Prerequisites

  • Python 3.10+
  • Google Cloud Project with Vertex AI API enabled.
  • Google Cloud Credentials configured (e.g., via gcloud auth application-default login).

Setup

  1. Clone the repository (if applicable).
  2. Install dependencies:
    pip install -r requirements.txt
  3. Configure Environment: Ensure you have a .env file in rag_agent/.env or set the environment variables:
    • GOOGLE_CLOUD_PROJECT: Your Google Cloud Project ID.
    • GOOGLE_CLOUD_LOCATION: Your Google Cloud Region (e.g., us-central1).

Running the Agent

Windows

Due to permission issues with symbolic links on Windows, use the provided helper script:

.\.venv\Scripts\python run_agent.py

Linux/Mac

You can run the agent directly using the ADK CLI:

adk run rag_agent

Web Interface

To run the agent with a web interface:

adk web

Then open http://localhost:8000 in your browser.

Troubleshooting

"invalid_grant" or "RefreshError"

If you encounter authentication errors, refresh your credentials:

gcloud auth application-default login

"os.symlink" Error (Windows)

If you see an OSError: [WinError 1314] A required privilege is not held by the client regarding os.symlink, please use the run_agent.py script as described in the "Running the Agent" section.

About

A Retrieval Augmented Generation (RAG) agent built with Google Cloud Vertex AI and the Agent Development Kit (ADK), capable of managing corpora and answering questions from documents.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages