Developed for the "Intelligent Agents" course at the University of Piraeus, CS Student Copilot is an AI-powered assistant designed to help computer science students with coding, studying, and academic research. It provides a unified interface for code generation and debugging, knowledge base management, and academic paper search—all accessible via CLI or a user-friendly Streamlit web app.
The CS Student Copilot is comprised of a coordinator that routes tasks to three specialized agents:
-
CodeHelper 👨💻
- Generate, debug, and explain code in Python or other languages.
- Execute code snippets.
- Analyze and improve code files or folders.
- Read and summarize code files.
-
StudyBuddy 📖
- Creates a searchable knowledge base from your local
.pdfand.txtfiles (e.g., lecture notes, e-books, documentation, articles). - Ask questions in natural language and get answers synthesized directly from your own documents, complete with source citations.
- Uses a robust, custom chain to provide reliable and well-formatted answers without unpredictable agent behavior.
- Creates a searchable knowledge base from your local
-
ScholarScout 🎓
- Uses the Semantic Scholar API to find relevant papers based on keywords, topics, or authors.
- Retrieves detailed abstracts and "TL;DR" summaries for specific papers.
- Can download the PDF of any open-access paper directly to a local folder, automatically naming the file with the paper's title.
- Python 3.11 or higher.
gitfor cloning the repository.- (For StudyBuddy): A local Ollama instance running with an embedding model.
git clone https://github.com/DimGiagias/cs_student_copilot.git
cd cs_student_copilotYou can use the provided setup script for easy environment setup (on Linux):
with uv:
./setup.sh --uvwith pip:
./setup.shOr use the requirements.txt file directly:
pip install -r requirements.txtThe application requires an API key from OpenRouter.ai to access free LLMs.
- Create a .env file in the root of the project directory (an example is provided):
cp .env.example .env- Open the .env file and paste your OpenRouter API key:
OPENROUTER_API_KEY="your_openrouter_api_key_here"Note: For embedding, you need to set up a local Ollama model (see Ollama documentation). We recommend
mxbai-embed-large
ollama pull mxbai-embed-largeRun the CLI tool:
python3 main_cli.py-
CodeHelper:
python3 main_cli.py codehelper "Write a Python function to reverse a string." -
StudyBuddy:
- Index documents:
python3 main_cli.py studybuddy index --path ./my_notes
- Ask a question:
python3 main_cli.py studybuddy ask "Summarize the main concepts in my calculus notes."
- Index documents:
-
ScholarScout:
python3 main_cli.py scholarscout "Find recent papers about transformers in NLP."
Launch the web app:
streamlit run app_streamlit.py- Select your assistant from the sidebar.
- Chat with CodeHelper, StudyBuddy, or ScholarScout.
- Manage your knowledge base and view example prompts.
-
agents/
Contains the core logic for each agent (code_helper.py,scholar_scout.py, etc.) and thecoordinator.pythat routes user requests. -
tools/
Holds the specialized tools that agents use to interact with external services (like the Semantic Scholar API) or the local filesystem. -
rag_components/
Contains theRAGManager, which encapsulates all the logic for StudyBuddy's Retrieval-Augmented Generation capabilities. -
core/
Includes project-wide configuration (config.py) and centralized model loading services (llm_service.py). -
main_cli.py
The entry point for the command-line interface. -
streamlit_app.py
The entry point for the Streamlit web UI. -
setup.sh
A simple shell script to automate environment setup.
This project is licensed under the MIT License. See the LICENSE file for details.