How bhancockio/adk-rag-agent works
This is a Vertex AI RAG agent: users ask knowledge questions or manage document corpora, and the ADK agent dispatches the request to a specialized tool. Querying retrieves matching corpus contexts; management tools create, ingest, inspect, list, and delete corpus data. The tools use shared corpus-name/state helpers and configuration defaults. The README documents Google Drive and GCS ingestion. Utility source was not sampled, so helper behavior and any additional internal wiring are shown only where tool code supports them.
Main entry points: agent.py RAG agent · utils.py Corpus helpers · rag_query.py Query corpus · create_corpus.py Create corpus
Components 14
Agent interface
- RAG agent
rag_agent/agent.py
RAG querying
- Query corpus
rag_agent/tools/rag_query.py
Corpus management
- List corpora
rag_agent/tools/list_corpora.py - Create corpus
rag_agent/tools/create_corpus.py - Add data
rag_agent/tools/add_data.py - Corpus details
rag_agent/tools/get_corpus_info.py - Delete document
rag_agent/tools/delete_document.py - Delete corpus
rag_agent/tools/delete_corpus.py
Shared support
- Corpus helpers
rag_agent/tools/utils.py - RAG defaults
rag_agent/config.py - Vertex initialization
rag_agent/__init__.py
Other components
- User
- Gemini model
- Vertex AI RAG
Connections 27
- User → RAG agent: requests
- RAG agent → Gemini model: uses model
- RAG agent → Query corpus: dispatches query
- RAG agent → List corpora: dispatches listing
- RAG agent → Create corpus: dispatches creation
- RAG agent → Add data: dispatches ingestion
- RAG agent → Corpus details: dispatches inspection
- RAG agent → Delete document: dispatches deletion
- RAG agent → Delete corpus: dispatches deletion
- Query corpus → Corpus helpers: checks corpus
- Query corpus → RAG defaults: reads defaults
- Query corpus → Vertex AI RAG: retrieves contexts
- Query corpus → RAG agent: returns results
- List corpora → Vertex AI RAG: lists corpora
- Create corpus → Corpus helpers: checks corpus
- Create corpus → RAG defaults: reads model default
- Create corpus → Vertex AI RAG: creates corpus
- Add data → Corpus helpers: checks corpus
- Add data → RAG defaults: reads chunk defaults
- Add data → Vertex AI RAG: imports files
- Corpus details → Corpus helpers: checks corpus
- Corpus details → Vertex AI RAG: lists files
- Delete document → Corpus helpers: checks corpus
- Delete document → Vertex AI RAG: deletes file
- Delete corpus → Corpus helpers: checks corpus
- Delete corpus → Vertex AI RAG: deletes corpus
- Vertex initialization → Vertex AI RAG: initializes client