A full-stack AI assistant application built with Google's Agent Development Kit (ADK), Pinecone vector database, and Next.js. This project demonstrates real-time voice/text interaction with AI agents, context-aware responses using RAG (Retrieval-Augmented Generation), and modern authentication.
- Real-time AI Voice & Text Chat: Bidirectional streaming with Google's Gemini Live API
- Context-Aware Responses: RAG implementation using Pinecone vector database
- Google Search Integration: Agent can search the web for real-time information
- Multi-modal Support: Handle both text and images in documents
- User Authentication: Firebase authentication with secure session management
- Modern UI: Built with Next.js 15, React 19, and Tailwind CSS
- WebSocket Communication: Real-time bidirectional streaming between client and server
┌─────────────────┐
│ Next.js │
│ Frontend │ ← User Interface (React 19 + Tailwind)
└────────┬────────┘
│
├─ Firebase Auth (Authentication)
├─ WebSocket (Real-time ADK streaming)
│
┌────────▼────────┐
│ FastAPI │
│ ADK Server │ ← Google ADK Agent + WebSocket
└────────┬────────┘
│
├─ Google Gemini API (AI Model)
├─ Google Search (Web search)
│
┌────────▼────────┐
│ FastAPI │
│ Pinecone API │ ← Vector DB + RAG
└─────────────────┘
- Python 3.10+ (for backend services)
- Node.js 18+ (for frontend)
- Google Cloud Account with Gemini API access
- Pinecone Account (free tier available)
- Firebase Project (for authentication)
git clone https://github.com/ashwinkrishna979/pipadk.git
cd pipadkcp .env.example .env
# Edit .env and add your configurationRequired variables:
DEMO_AGENT_MODEL: Gemini model name (default provided)PINECONE_API_URL: URL to your Pinecone API service
cd pinecone-api
cp .env.example .env
# Edit .env and add your Pinecone API keyGet your Pinecone API key from: https://app.pinecone.io/
cd frontend
cp .env.example .env.local
# Edit .env.local and add your Firebase and API configurationsFirebase configuration can be found in your Firebase Console:
- Project Settings → General → Your apps → SDK setup and configuration
# From root directory
pip install -e .
# or use uv for faster installation
uv pip install -e .cd pinecone-api
pip install -e .
# or
uv pip install -e .cd frontend
npm install
# or
yarn installYou'll need 3 terminal windows:
cd pinecone-api
python -m app.app
# Runs on http://localhost:8000cd app
python main.py
# Runs on http://localhost:8001 (WebSocket)cd frontend
npm run dev
# Runs on http://localhost:3000Open your browser and navigate to:
- Main App: http://localhost:3000
- Dashboard: http://localhost:3000/dashboard
- Live Assistant: http://localhost:3000/live-assistant-new
pipadk/
├── app/ # ADK Agent Service (FastAPI + WebSocket)
│ ├── main.py # FastAPI application entry point
│ ├── package.json # Node.js dependencies (if any)
│ └── root_agent/ # Root agent implementation
│ ├── __init__.py
│ └── agent.py # Agent definition with tools
│
├── pinecone-api/ # Pinecone Vector DB Service
│ ├── pyproject.toml # Python dependencies
│ ├── README.md # Service documentation
│ ├── app/
│ │ ├── __init__.py
│ │ ├── app.py # FastAPI app for RAG operations
│ │ └── schema.py # Pydantic schemas
│ └── auth/ # Authentication utilities
│
├── frontend/ # Next.js 15 Frontend
│ ├── package.json # Node.js dependencies
│ ├── next.config.ts # Next.js configuration
│ ├── tsconfig.json # TypeScript configuration
│ ├── tailwind.config.ts # Tailwind CSS configuration
│ ├── app/ # App router pages
│ │ ├── layout.tsx # Root layout
│ │ ├── page.tsx # Home page
│ │ ├── globals.css # Global styles
│ │ ├── dashboard/ # Document upload & management
│ │ │ └── page.tsx
│ │ ├── live-assistant/ # Enhanced voice assistant with ADK
│ │ │ ├── page.tsx
│ │ │ ├── ADKStreamingClient.ts
│ │ │ ├── AudioPlayer.ts
│ │ │ ├── types.ts
│ │ │ ├── components.tsx
│ │ │ └── LiveAssistantLayout.tsx
│ │ ├── live-test-interface/ # Full-featured voice assistant test UI
│ │ │ ├── page.tsx
│ │ │ ├── ADKStreamingClient.ts
│ │ │ ├── AudioPlayer.ts
│ │ │ └── types.ts
│ │ ├── example/ # Example page template
│ │ │ └── page.tsx
│ │ ├── login/ # Login page
│ │ │ └── page.tsx
│ │ └── signup/ # Sign up page
│ │ └── page.tsx
│ ├── components/ # Reusable React components
│ │ ├── Navbar.tsx # Navigation bar
│ │ ├── auth/ # Authentication components
│ │ │ ├── auth-card.tsx
│ │ │ ├── login-form.tsx
│ │ │ ├── logout.tsx
│ │ │ └── signup-form.tsx
│ │ └── ui/ # shadcn/ui components
│ │ ├── button.tsx
│ │ ├── card.tsx
│ │ ├── form.tsx
│ │ ├── input.tsx
│ │ ├── label.tsx
│ │ └── toast.tsx
│ ├── hooks/ # Custom React hooks
│ │ └── use-toast.ts
│ ├── lib/ # Utility libraries
│ │ ├── firebase.ts # Firebase configuration
│ │ ├── liveapi-client.ts # ADK WebSocket client
│ │ └── utils.ts # Utility functions
│ ├── public/ # Static assets
│ ├── config.ts # Application configuration
│ └── proxy.ts # Authentication middleware
│
├── .env.example # Example environment variables
├── pyproject.toml # Root Python project configuration
├── setup-env.sh # Environment setup helper script
├── install_optimizations.sh # Installation optimization script
├── README.md # This file
├── CONTRIBUTING.md # Contribution guidelines
├── SECURITY.md # Security best practices
├── LICENSE # MIT License
├── PRE_PUBLICATION_CHECKLIST.md # Pre-publication checklist
├── PERFORMANCE_OPTIMIZATIONS.md # Performance optimization notes
└── EVENT_CALLBACK_FLOW.md # Event callback flow documentation
DEMO_AGENT_MODEL: Gemini model to use (e.g.,gemini-2.5-flash-native-audio-preview-12-2025)PINECONE_API_URL: URL to Pinecone API service (default:http://localhost:8000)GOOGLE_APPLICATION_CREDENTIALS: Path to Google Cloud service account JSON (if using Vertex AI)
PINECONE_API_KEY: Your Pinecone API key from https://app.pinecone.io/
-
Firebase Config (from Firebase Console):
NEXT_PUBLIC_FIREBASE_API_KEYNEXT_PUBLIC_FIREBASE_AUTH_DOMAINNEXT_PUBLIC_FIREBASE_PROJECT_IDNEXT_PUBLIC_FIREBASE_APP_IDNEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID
-
Firebase Admin SDK (for server-side):
FIREBASE_ADMIN_CLIENT_EMAILFIREBASE_ADMIN_PRIVATE_KEY
-
Cookie Authentication:
AUTH_COOKIE_NAME: Cookie name for auth tokenAUTH_COOKIE_SIGNATURE_KEY_CURRENT: Secret key for signing cookies (min 32 chars)AUTH_COOKIE_SIGNATURE_KEY_PREVIOUS: Previous secret key for rotationUSE_SECURE_COOKIES: Set totruein production
-
API URLs:
NEXT_PUBLIC_PINECONE_API_URL: Pinecone API URL (default:http://localhost:8000)NEXT_PUBLIC_ADK_WS_URL: ADK WebSocket URL (default:ws://localhost:8001)
# Generate random 32+ character strings
node -e "console.log(require('crypto').randomBytes(32).toString('base64'))"- Real-time voice interaction with AI
- Audio streaming using WebSocket
- Native audio support with Gemini
- Located at
/live-assistant
- Upload documents (PDF, text, images)
- Vector embeddings for semantic search
- Context-aware responses using retrieved information
- Multi-modal document support
- Agent can search the web in real-time
- Provides up-to-date information
- Integrated seamlessly with RAG
- Secure user registration and login
- Session management with HTTP-only cookies
- Protected routes and API endpoints
# Backend tests
pytest
# Frontend tests (if configured)
cd frontend
npm test# Python
black .
pylint app/
# TypeScript/JavaScript
cd frontend
npm run lintcd frontend
npm run build
npm start- URL:
ws://localhost:8001/ws/{user_id}/{session_id} - Protocol: WebSocket bidirectional streaming
- Events: See ADK documentation for event types
- POST
/chat_response/: Query the RAG system - POST
/upload/: Upload files to vector database - GET
/list_files/: List uploaded files - DELETE
/delete_file/{file_id}: Delete a file
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Google ADK: Agent Development Kit for building AI agents
- Pinecone: Vector database for semantic search
- Firebase: Authentication and backend services
- Next.js: React framework for production
- shadcn/ui: Beautiful and accessible components
Ashwin Mariyathu Krishnakumar
- GitHub: @ashwinkrishna979
- Email: ashwinkrishna979@gmail.com
- API Keys: Never commit your
.envfiles to version control - Production: Set
USE_SECURE_COOKIES=trueand use HTTPS in production - Costs: Be aware of API usage costs for Google Cloud, Pinecone, and Firebase
- Rate Limits: Implement rate limiting for production deployments
- Add authentication layer in backend and pinecone API
- Add per-user segregation for document storage
- Add user dashboard with usage statistics
- Implement conversation history
- Add support for more document types
- Deploy to cloud platforms (Vercel, Google Cloud)
- Add comprehensive test coverage
- Improve caching layer for improved performance