Skip to content

About

Wikipedia-grounded retrieval-augmented chatbot built with Streamlit and Google Gemini

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

RAG Chatbot — Wikipedia-Grounded Q&A

A minimal retrieval-augmented generation chatbot built with Streamlit. Each question is first used to fetch a relevant Wikipedia summary; that summary is passed to Google's Gemini model as context, so answers are grounded in retrieved text rather than the model's memory alone. If Wikipedia has no matching article, the question falls through to the model directly.

Originally built for crop-disease questions, but the retrieval step is topic-agnostic.

How it works

question → Wikipedia REST summary API → context (or None)
         → Gemini 1.5 Flash (context + question) → answer → Streamlit
  • Retrieval: https://en.wikipedia.org/api/rest_v1/page/summary/{topic}
  • Generation: gemini-1.5-flash-latest via the Generative Language API

Running it

pip install -r requirements.txt
export GEMINI_API_KEY="your-key"
streamlit run chatbotwithRAGwikitaxonapi.py

Get a key from Google AI Studio. See .env.example. The key is read from the environment — do not hardcode it into the source.

Stack

Python · Streamlit · Google Gemini API · Wikipedia REST API

Limitations

  • Retrieval is a single exact-title Wikipedia lookup, not a vector search over a corpus, so it only matches when the question closely resembles an article title.
  • No conversation memory; each question is answered independently.
  • Only the article summary is retrieved, not full article text.

About

Wikipedia-grounded retrieval-augmented chatbot built with Streamlit and Google Gemini

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages