Skip to content

tun1r/Capstone-Project

Repository files navigation

Internship Copilot

Production-style capstone agent for internship search and application workflow.

Architecture

Streamlit UI (port 8501)
    ↓ HTTP
FastAPI Backend (port 8000)
    ↓ Python import
copilot/ package
    ├── config.py    — env vars, provider resolution
    ├── state.py     — LangGraph TypedDict
    ├── documents.py — doc loading, cleaning, chunking
    ├── chroma.py    — ChromaDB collection builder
    ├── llm.py       — OpenAI-compatible client
    ├── tools.py     — web search + Application Fit Scorer
    ├── router.py    — LLM-based message router
    ├── nodes.py     — all 8 graph node functions
    └── graph.py     — StateGraph assembly

What it does

  • Answers internship questions from a local ChromaDB knowledge base
  • Indexes chunked official-source documents with source URL metadata
  • Remembers conversation history across turns with LangGraph + thread_id
  • Uses live web search for current company or deadline questions
  • Application Fit Scorer: custom tool that scores resume-to-job-posting fit
  • Self-checks answers with an eval loop and retries when grounding is weak
  • Full-stack deployment: Streamlit frontend → FastAPI backend → LangGraph agent

Supported model providers

The app uses the OpenAI-compatible client, so one code path works with:

  • OpenAI
  • Groq
  • OpenRouter

Setup

cd "Capstone Project"
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

Create a .env file with one of these keys:

OPENAI_API_KEY=...
# optional
GROQ_API_KEY=...
OPENROUTER_API_KEY=...

Optional runtime variables:

CAPSTONE_PROVIDER=auto
CAPSTONE_MODEL=gpt-4o-mini
CAPSTONE_MODEL_GROQ=llama-3.3-70b-versatile
CAPSTONE_MODEL_OPENROUTER=openai/gpt-4o-mini

Run

Terminal 1 — FastAPI backend:

uvicorn capstone_api:app --reload --port 8000

Terminal 2 — Streamlit frontend:

streamlit run capstone_streamlit.py

Then open http://localhost:8501 in your browser.

API endpoints

  • GET /health — server status and KB stats
  • GET /topics — list of KB topics
  • POST /ask — ask a question (returns answer, route, sources, faithfulness)
  • Interactive docs at http://localhost:8000/docs

Run the test suite

python run_capstone_tests.py --provider openai

This runs 10 capstone-style questions, including memory and 2 red-team tests, and writes test_results.json.

Run the baseline evaluation

python run_baseline_eval.py --provider openai

If ragas is installed, the script runs a small RAGAS baseline. Otherwise it falls back to the agent's internal faithfulness scores.

Current verified results

  • Capstone test suite: 10/10 passed
  • Red-team tests: 2/2 passed
  • Average test faithfulness: 0.90
  • Baseline internal faithfulness fallback: 0.800

Project files

  • copilot/ — modular agent package
  • agent.py — thin re-export for backward compatibility
  • capstone_streamlit.py — Streamlit frontend calling FastAPI
  • capstone_api.py — FastAPI backend
  • run_capstone_tests.py — 10-question integration test runner
  • run_baseline_eval.py — baseline evaluation helper
  • WRITTEN_SUMMARY.md — submission-ready written summary
  • docs/ — local RAG source documents from official web pages
  • requirements.txt — dependencies
  • README.md — this file

Notes

  • The knowledge base is loaded from markdown files in docs/
  • These docs are official-page extracts, mainly from Berkeley Career Engagement and Microsoft Careers
  • Each page is chunked before indexing so retrieval can target the relevant section instead of an entire file
  • Chroma stores the local vector index in .chroma/
  • If you want to rebuild the KB from scratch, delete .chroma/
  • The web search tool depends on live internet access
  • The Application Fit Scorer is the project's original custom tool

Environment note

The current workspace uses Python 3.14, which triggers a warning from langchain_core, but the app, API, and test runner all worked in this project venv. If you want the cleanest runtime for demos, Python 3.11 or 3.12 is a safer target.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors