An intelligent web research assistant that leverages AI to help users gather, process, and understand information from multiple web sources efficiently.
The goal of this project was to understand how modern AI systems:
- Combine LLMs with external knowledge
- Scale beyond prompt-only approaches
- Reduce hallucinations using vector search
- Web Content Ingestion: Automatically extract and process content from multiple URLs
- Semantic Search: Find relevant information using vector embeddings
- Question Answering: Get precise answers to your research questions
- Document Processing: Automatically chunk and index documents for efficient retrieval
- Modern Web Interface: Intuitive Streamlit-based UI for easy interaction
graph TD
A[User] -->|Interacts with| B[Streamlit Frontend]
B -->|Sends Requests| C[FastAPI Backend]
C -->|Processes with| D[LangChain]
D -->|Stores/Retrieves| E[ChromaDB]
D -->|Uses| F[Embedding Models]
C -->|Fetches Data| G[Web Sources]
style A fill:#c0392b,stroke:#333,color:white,stroke-width:2px,font-weight:bold
style B fill:#2980b9,stroke:#333,color:white,stroke-width:2px,font-weight:bold
style C fill:#27ae60,stroke:#333,color:white,stroke-width:2px,font-weight:bold
style D fill:#8e44ad,stroke:#333,color:white,stroke-width:2px,font-weight:bold
style E fill:#16a085,stroke:#333,color:white,stroke-width:2px,font-weight:bold
style F fill:#f39c12,stroke:#333,color:white,stroke-width:2px,font-weight:bold
style G fill:#d35400,stroke:#333,color:white,stroke-width:2px,font-weight:bold
The system follows a modern microservices architecture with the following components:
- Frontend: Streamlit-based web interface
- Backend API: FastAPI server handling business logic
- Vector Database: ChromaDB for efficient similarity search
- AI Processing: LangChain for document processing and question answering
- Web Scraping: BeautifulSoup4 for content extraction
KnowBaseRAG/
├── backend/ # FastAPI backend service
│ ├── app/
│ │ ├── main.py # FastAPI entry point and routes
│ │ ├── models/ # Pydantic data models
│ │ ├── routes/ # API endpoints (modularized)
│ │ ├── services/ # Business logic
│ │ │ ├── llm_service.py # LLM integration
│ │ │ ├── nlp_service.py # Text cleaning and chunking
│ │ │ ├── scraping_service.py # Web content extraction
│ │ │ └── vector_store_service.py# ChromaDB integration
│ │ └── utils/ # Helper functions
│ ├── chroma_db/ # Local vector database storage
│ └── requirements.txt # Backend dependencies
├── frontend/ # Streamlit web interface
│ └── streamlit_app.py # Main UI application
├── data/ # Sample data and evaluation sets
├── notebooks/ # Jupyter notebooks for experimentation
├── LICENSE # MIT License
└── README.md # Project documentation
- Framework: FastAPI
- AI/ML: LangChain, Sentence Transformers
- Vector Database: ChromaDB
- Web Scraping: BeautifulSoup4, Requests
- NLP: NLTK
- Framework: Streamlit
- UI Components: Custom Streamlit components
- Python 3.8+
- pip (Python package manager)
- Clone the repository:
git clone https://github.com/yourusername/ai-web-intelligence-assistant.git
cd ai-web-intelligence-assistant- Set up the backend:
cd backend
python -m venv .venv
.venv\Scripts\activate # On Windows
pip install -r requirements.txt- Set up the frontend:
cd ../frontend
pip install -r requirements.txt- Start the backend server:
cd backend
uvicorn app.main:app --reload- In a new terminal, start the frontend:
cd frontend
streamlit run streamlit_app.py- Open your browser and navigate to
http://localhost:8501
-
Ingest Knowledge:
- Enter website URLs in the text area
- Click "Ingest URLs" to process the content
-
Ask Questions:
- Type your research question
- Click "Ask" to get AI-powered answers
This project uses a Retrieval-Augmented Generation (RAG) pipeline:
- Documents are embedded and stored in a vector database
- Relevant context is retrieved at query time
- The LLM generates answers strictly based on retrieved context
This prevents hallucinations and ensures source-grounded answers.
- Answers are limited to ingested sources only
- Large models may require higher system memory
- No authentication or multi-user support (yet)
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- LangChain for the amazing AI orchestration framework
- ChromaDB for the lightweight vector database
- Streamlit for the intuitive web interface