Click here to view the live project
Student Side | AI-Enhanced Teaching Assistant: Bridging Instructor Knowledge and Web Intelligence
Instructor Side | AI-Enhanced Teaching Assistant: Bridging Instructor Knowledge and Web Intelligence
Watch full Instructor side demo
This project implements an advanced AI-powered teaching assistant that combines knowledge from multiple professors with real-time web information to provide comprehensive, accurate, and personalized responses to student queries. The system leverages a team of AI agents working collaboratively to enhance the learning experience across various subjects and professors.
- Integrate knowledge from multiple professors with up-to-date web information.
- Provide personalized and comprehensive responses to student queries.
- Enhance student learning through interactive and adaptive content presentation.
- Demonstrate the effective use of LangGraph and Tavily API in a multi-agent system.
- Multi-Professor Support: Students can select from multiple professors, accessing specialized knowledge bases for each.
- Web-Enhanced Responses: Combines professor-specific knowledge with current web information for comprehensive answers.
- Personalized Learning: Tailors responses based on the selected professor and student preferences.
- Multi-source Integration: Merges professors' notes and web information seamlessly.
- Intelligent Query Processing: Utilizes embeddings and language models for accurate understanding.
- Interactive Learning Formats: Supports MCQs, case studies, and various presentation styles.
- Multi-language Support: Includes dynamic translation for global accessibility.
The project uses a multi-agent system architecture:
- Query Processing Agent: Prepares and reformulates the user's query.
- Vector DB Agent: Searches the Pinecone database for relevant notes from the selected professor.
- Web Search Agent: Performs web searches using the Tavily API to supplement professor knowledge.
- Result Processing Agent: Synthesizes information from vector DB and web search.
- Response Formatting Agent: Structures the response in a consistent format.
- Translator Agent: Handles translation of the final response if needed.
The workflow of these agents is orchestrated using the LangGraph framework.
- FastAPI: Web framework for backend API.
- Pinecone: Vector storage for efficient retrieval of professor-specific knowledge.
- Tavily API: Web search for up-to-date information.
- LangGraph: Agent workflow orchestration.
- Amazon Bedrock: Language model inference.
- AWS Services: S3, Lambda, DynamoDB for cloud infrastructure.
- PyPDF2: PDF processing for professor notes and materials.
- Streamlit: User-friendly frontend interface.
-
Clone the repository:
git clone https://github.com/DHRUVvkdv/teaching-assistant.git cd ai-teaching-assistant
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables: Create a
.env
file in the root directory and add the following:TAVILY_API_KEY=your_tavily_api_key AWS_ACCESS_KEY_ID=your_aws_access_key AWS_SECRET_ACCESS_KEY=your_aws_secret_key
-
Initialize the Pinecone index:
python scripts/initialize_pinecone.py
-
Run the FastAPI server:
uvicorn main:app --reload
-
streamlit run streamlit_app.py
- POST /combined_query: Submit a query for processing by the AI teaching assistant.
- GET /query_status/{query_id}: Check the status of a submitted query.
- POST /process_all_pdfs: Process and index all PDFs for a specific teacher.
- GET /list_processed_files: List all processed files for a teacher.
import requests
API_BASE_URL = "http://api-base-url.com"
API_KEY = "api_key_here"
# Submit a query
query_data = {
"query_text": "How does pressure work in fluids?",
"teacher_name": "drvinay",
"target_language": "en"
}
headers = {
"API-Key": API_KEY,
"Content-Type": "application/json"
}
response = requests.post(f"{API_BASE_URL}/combined_query", json=query_data, headers=headers)
query_id = response.json()["query_id"]
# Check query status
status_response = requests.get(f"{API_BASE_URL}/query_status/{query_id}", headers=headers)
print(status_response.json())
# Process all PDFs for a teacher
process_data = {"teacher_name": "drvinay"}
process_response = requests.post(f"{API_BASE_URL}/process_all_pdfs", json=process_data, headers=headers)
print(process_response.json())
# List processed files
list_response = requests.get(f"{API_BASE_URL}/list_processed_files?teacher_name=drvinay", headers=headers)
print(list_response.json())
The Streamlit-based user interface provides the following features:
- Customizable themes and fonts.
- Dynamic, searchable language selection.
- Options for different presentation styles.
- MCQ generation based on query results.
- Real-time, client-side translation of results.
We welcome contributions to the AI-Enhanced Teaching Assistant project. Please follow these steps to contribute:
- Fork the repository.
- Create a new branch:
git checkout -b feature/AmazingFeature
- Make your changes.
- Commit your changes.
git commit -m 'Add some AmazingFeature'
- Push to the branch:
git push origin feature/AmazingFeature
- Open a Pull Request
This project is licensed under the MIT License - see the LICENSE.md file for details.
- Tavily API for providing powerful web search capabilities.
- LangGraph framework for enabling the creation of complex AI agent workflows.
- The open-source community for their invaluable contributions to the tools and libraries used in this project.