Spaces:
Configuration error
Configuration error
RISHABH KUMAR commited on
Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Intelligent AI Search Engine Agent π€π
|
| 2 |
+
|
| 3 |
+
An intelligent agentic search engine powered by **Groq's Llama3-8b**, Streamlit, and multi-source search tools (DuckDuckGo, Arxiv, Wikipedia). Built with LangChain for robust AI agent orchestration.
|
| 4 |
+
|
| 5 |
+
 *(Replace with your demo GIF)*
|
| 6 |
+
|
| 7 |
+
## Features β¨
|
| 8 |
+
- **Multi-Source Search**: Integrates 3 powerful tools:
|
| 9 |
+
- π¦ DuckDuckGo (web search)
|
| 10 |
+
- π Arxiv (scientific papers)
|
| 11 |
+
- π Wikipedia (encyclopedic knowledge)
|
| 12 |
+
- **Groq-Powered AI**: Utilizes Groq's ultra-fast Llama3-8b model
|
| 13 |
+
- **Smart Agent Optimization**:
|
| 14 |
+
- Auto-stop when sufficient information is found
|
| 15 |
+
- Max 3 iterations to prevent infinite loops
|
| 16 |
+
- Concise answer prioritization
|
| 17 |
+
- **Streamlit UI**: User-friendly interface with chat history
|
| 18 |
+
- **Error Handling**: Robust parsing and API error recovery
|
| 19 |
+
|
| 20 |
+
## Getting Started π
|
| 21 |
+
|
| 22 |
+
### Prerequisites
|
| 23 |
+
- Python 3.8+
|
| 24 |
+
- [Groq API Key](https://console.groq.com/)
|
| 25 |
+
- `.env` file for API keys (optional)
|
| 26 |
+
|
| 27 |
+
### Installation
|
| 28 |
+
```bash
|
| 29 |
+
git clone https://github.com/yourusername/ai-search-agent.git
|
| 30 |
+
cd ai-search-agent
|
| 31 |
+
pip install -r requirements.txt
|
| 32 |
+
```
|
| 33 |
+
|
| 34 |
+
### Setup
|
| 35 |
+
1. Get Groq API key from [Groq Console](https://console.groq.com/)
|
| 36 |
+
2. Create `.env` file:
|
| 37 |
+
```env
|
| 38 |
+
GROQ_API_KEY=your_key_here
|
| 39 |
+
```
|
| 40 |
+
|
| 41 |
+
### Run the App
|
| 42 |
+
```bash
|
| 43 |
+
streamlit run app2.py # Recommended: optimized version
|
| 44 |
+
# or
|
| 45 |
+
streamlit run app.py
|
| 46 |
+
```
|
| 47 |
+
|
| 48 |
+
## Usage π‘
|
| 49 |
+
1. Enter Groq API key in sidebar
|
| 50 |
+
2. Ask questions in natural language:
|
| 51 |
+
- "Explain quantum computing basics"
|
| 52 |
+
- "Latest research on LLM optimization"
|
| 53 |
+
- "Compare CNN and RNN architectures"
|
| 54 |
+
3. Watch the agent intelligently combine search sources!
|
| 55 |
+
|
| 56 |
+
## Code Versions π
|
| 57 |
+
- **`app.py`**: Base implementation with custom DuckDuckGo search
|
| 58 |
+
- **`app2.py` (Recommended)**: Enhanced version with:
|
| 59 |
+
- Official DuckDuckGoSearchRun tool
|
| 60 |
+
- System instruction prompts
|
| 61 |
+
- Limited iterations (3 max)
|
| 62 |
+
- Early stopping mechanism
|
| 63 |
+
- More robust error handling
|
| 64 |
+
|
| 65 |
+
## Deployment βοΈ
|
| 66 |
+
Project is Deployed at Streamlit Community Cloud:
|
| 67 |
+
|
| 68 |
+
1. Go to [Streamlit Console](https://share.streamlit.io/)
|
| 69 |
+
2. Enter your Groq API Key
|
| 70 |
+
3. Search your query with Intelligent AI Search-Engine
|
| 71 |
+
|
| 72 |
+
## Contributing π€
|
| 73 |
+
PRs welcome! Please follow:
|
| 74 |
+
1. Fork the repository
|
| 75 |
+
2. Create feature branch
|
| 76 |
+
3. Submit PR with detailed description
|
| 77 |
+
|
| 78 |
+
## License π
|
| 79 |
+
MIT License - See [LICENSE](LICENSE)
|
| 80 |
+
|
| 81 |
+
## Acknowledgments π
|
| 82 |
+
- Groq for LLM infrastructure
|
| 83 |
+
- LangChain team for agent framework
|
| 84 |
+
- Streamlit for UI components
|