File size: 2,843 Bytes
21ace90
 
 
9544286
21ace90
7df3040
9544286
21ace90
 
 
 
9544286
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
---
title: ChronoQuery
emoji: 🏆
colorFrom: red
colorTo: blue
sdk: streamlit
sdk_version: 1.50.0
pinned: false
short_description: Unlock the past  ask about any historical event and get ins
---

**ChronoQuery** is an intelligent, AI-powered historical event explainer that allows users to explore the past interactively.  
Just type in a historical event, figure, or question — and get **instant, research-backed insights** compiled from reliable sources like **Wikipedia** and **DuckDuckGo Search**, all refined through **Google’s Gemini AI**.  

---

## 🧠 What It Is  

ChronoQuery is an **AI history assistant** built with **Streamlit** and **LangChain**, powered by **Google’s Gemini 2.5 Flash model**.  
It’s designed to help users learn about historical topics effortlessly — whether you’re a student, researcher, or just curious about world events.  

---

## ⚙️ What It Does  

✅ Takes any historical question or event as input  
✅ Automatically identifies the **core topic or event** using an AI-based topic extractor  
✅ Fetches relevant content from **Wikipedia** and **DuckDuckGo**  
✅ Combines and refines the data using **Gemini AI** for an accurate, contextualized answer  
✅ Displays results in an elegant, user-friendly Streamlit interface  

---

## 🔍 How It Works  

ChronoQuery uses a modular AI workflow powered by **LangChain Runnables**:  

1. **User Query → Topic Extraction**  
   - The app identifies the main topic or event using Gemini’s language understanding.  

2. **Knowledge Retrieval**  
   - Fetches relevant summaries from **Wikipedia** (via `WikipediaRetriever`).  
   - Collects additional web context using **DuckDuckGo Search**.  

3. **Data Combination**  
   - Both Wikipedia and web data are merged into a unified context string.  

4. **AI Reasoning & Summarization**  
   - The combined data is sent to **Gemini 2.5 Flash**, which formulates a detailed, coherent response.  

5. **Output Rendering**  
   - Streamlit displays the results beautifully, allowing users to query multiple times interactively.  

---

## 🧩 Technologies Used  

| Component | Technology / Library | Purpose |
|------------|----------------------|----------|
| 🧱 Framework | **Streamlit** | Builds the interactive web interface |
| 🧠 AI Model | **Google Gemini 2.5 Flash (via `google.generativeai`)** | Generates contextual answers |
| 🔗 Orchestration | **LangChain (core, community)** | Manages chains, prompts, and data flow |
| 📚 Knowledge Base | **WikipediaRetriever** | Retrieves factual content |
| 🌐 Web Search | **DuckDuckGoSearchRun** | Adds recent or broader information |
| 🧩 Utilities | **RunnableLambda, RunnableParallel, StrOutputParser** | Custom data pipelines and parsing |
| 💾 Language | **Python 3.10+** | Main development language |

---