dev-2106/Conversational-AI-Agent
0
๐ LangChain - Chat with Search
An AI-powered chatbot that can search the web, query Wikipedia, and find research papers on Arxiv โ all in real time using Groq LLM and LangChain Agents. Free to use!
๐ What Does This App Do?
This app is a smart conversational agent that can:
- ๐ Search the web using DuckDuckGo for current information
- ๐ Search Wikipedia for factual and encyclopedic knowledge
- ๐ฌ Search Arxiv for academic research papers
- ๐ฌ Maintains chat history across the entire conversation
- ๐ง Shows its thinking process โ watch the agent reason step by step in real time
๐ ๏ธ How It Works
User asks a question
โ
โผ
Groq LLM (llama-3.1-8b-instant) decides which tool to use
โ
โโโโบ DuckDuckGo Search โ for general web queries
โโโโบ Wikipedia โ for factual knowledge
โโโโบ Arxiv โ for research papers
โ
โผ
Agent reasons through results (ReAct framework)
โ
โผ
Final answer streamed back to user via StreamlitThe agent uses the ZERO_SHOT_REACT_DESCRIPTION strategy โ it reads the tool descriptions and decides on its own which tool best answers each question.
โ๏ธ Tech Stack
โ Only requires a free Groq API key โ no other API keys needed!
๐ How to Use
On HuggingFace Spaces:
- Open the app
- Enter your free Groq API key in the sidebar (get one here)
- Type any question in the chat input
- Watch the agent search and reason in real time!
Run Locally:
1. Clone the repo:
git clone https://huggingface.co/spaces/dev-2106/langchain-chat-search
cd langchain-chat-search2. Install dependencies:
pip install streamlit langchain langchain-groq langchain-community duckduckgo-search wikipedia arxiv python-dotenv3. Create `.env` file:
GROQ_API_KEY=your-groq-api-key4. Run the app:
streamlit run app.py๐ API Keys Required
DuckDuckGo, Wikipedia, and Arxiv require no API keys at all.
๐ก Features
- โ Real-time streaming โ see the response being generated token by token
- โ Agent thought process visible โ watch the agent decide which tool to use
- โ 3 search tools โ web, Wikipedia, and Arxiv all in one chatbot
- โ Chat history โ full conversation context maintained across messages
- โ No OpenAI needed โ powered entirely by free Groq inference
๐ Requirements
streamlit
langchain
langchain-groq
langchain-community
duckduckgo-search
wikipedia
arxiv
python-dotenv๐ Common Issues & Fixes
๐ License
This project is open source and available under the MIT License.
<p align="center">Built with โค๏ธ using LangChain, Groq and Streamlit</p>
