Production-style capstone agent for internship search and application workflow.
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
- 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
The app uses the OpenAI-compatible client, so one code path works with:
- OpenAI
- Groq
- OpenRouter
cd "Capstone Project"
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtCreate 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-miniTerminal 1 — FastAPI backend:
uvicorn capstone_api:app --reload --port 8000Terminal 2 — Streamlit frontend:
streamlit run capstone_streamlit.pyThen open http://localhost:8501 in your browser.
GET /health— server status and KB statsGET /topics— list of KB topicsPOST /ask— ask a question (returns answer, route, sources, faithfulness)- Interactive docs at
http://localhost:8000/docs
python run_capstone_tests.py --provider openaiThis runs 10 capstone-style questions, including memory and 2 red-team tests, and writes test_results.json.
python run_baseline_eval.py --provider openaiIf ragas is installed, the script runs a small RAGAS baseline. Otherwise it falls back to the agent's internal faithfulness scores.
- Capstone test suite:
10/10passed - Red-team tests:
2/2passed - Average test faithfulness:
0.90 - Baseline internal faithfulness fallback:
0.800
copilot/— modular agent packageagent.py— thin re-export for backward compatibilitycapstone_streamlit.py— Streamlit frontend calling FastAPIcapstone_api.py— FastAPI backendrun_capstone_tests.py— 10-question integration test runnerrun_baseline_eval.py— baseline evaluation helperWRITTEN_SUMMARY.md— submission-ready written summarydocs/— local RAG source documents from official web pagesrequirements.txt— dependenciesREADME.md— this file
- 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
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.