Skip to content

Repository files navigation

Multimodal Adaptive RAG Application

This repository contains a production-ready Multimodal Adaptive RAG application utilizing LangGraph, Vertex AI Vector Search, Neo4j Graph RAG, NeMo Guardrails, and Streamlit.

🛠️ 1. Local Development Setup

Since you already have gcloud authenticated on your local machine, your Application Default Credentials (ADC) will be automatically picked up by the Google Cloud SDKs.

Prerequisites

Step 1: Install Dependencies

Ensure your virtual environment is activated, then install the dependencies:

pip install -e .

(If you haven't installed pip-tools and generated requirements, you can install directly from pyproject.toml: pip install .)

Step 2: Environment Variables

Create a .env file in the root directory:

APP_ENV=development
GCP_PROJECT_ID=your-gcp-project-id
REGION=us-central1

# Neo4j Settings
NEO4J_URI=neo4j+s://your-db-id.databases.neo4j.io
NEO4J_USERNAME=neo4j
NEO4J_PASSWORD=your-neo4j-password

# Redis Settings (Local)
REDIS_HOST=localhost
REDIS_PORT=6379

# Disable Secret Manager for local dev to use local .env
USE_SECRET_MANAGER=false

Step 3: Start Local Infrastructure (Redis)

If you don't have Redis installed natively, run it via Docker:

docker run -p 6379:6379 -d redis

Step 4: Run the Backend (FastAPI)

Start the FastAPI server:

python -m app.main

The API will be available at http://localhost:8000.

Step 5: Run the Frontend (Streamlit)

Open a new terminal, activate the venv, and run:

streamlit run frontend/app.py

The UI will open at http://localhost:8501. Log in with any demo email/password.


☁️ 2. Deploy to GCP (Using gcloud)

If you want to deploy the application to Google Cloud Run from your local machine, use the provided PowerShell scripts. They will use your existing GCP project and automatically integrate with your existing ai-sdlc-redis instance.

Step 1: Provision Missing Infrastructure

Run the setup script to enable APIs, create the storage buckets, and setup the Pub/Sub topics required for the RAG pipeline. It will safely skip any resources (like Firestore or your existing Redis) that you already created.

cd deploy
.\setup-gcp-infrastructure-rag.ps1

Step 2: Deploy to Cloud Run

Run the deployment script. This will use Google Cloud Build to build your Docker images in the cloud (so you don't need Docker Desktop running) and deploy the Backend, Frontend, and Ingestion services.

.\deploy-cloud-run.ps1

About

Multimodal Retrieval-Augmented Generation (RAG) system powered by Graph Data Structures and Vector Search.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages