How vedhakoushik/placement-prep-agent works
1. What this repository is
- A capstone “placement prep” agent that helps a user research a company, synthesize interview prep context, and generate tailored questions.
- The repo is organized as a progression from learning exercises to a production-like app, with the final path centered on a LangGraph workflow plus a web UI and CLI entrypoints.
2. Primary runtime surfaces
- main.py is the main command-line entrypoint for setup checks, research runs, tests, and launching the app.
- webapp/app.py plus webapp/templates/ and webapp/static/ form a browser UI layer with pages for research, chat, company history, progress, and settings.
- The README references Streamlit, but the file tree strongly suggests the shipped UI boundary is a template/static web app (Flask-style) rather than only Streamlit.
3. Core orchestration layer
- The final application logic appears to live in week5/day34_35_app.py, which the README identifies as the LangGraph-based app.
- The central abstraction is a typed state object (ResearchState) that flows through a node pipeline. Each node reads the full state and returns only changed fields.
- The graph is a linear research pipeline with error accumulation rather than hard failure.
4. Main data flow
- User input starts with company, role, and focus.
- A metadata step extracts company facts.
- A research step gathers web snippets.
- A synthesis step turns the findings into a short briefing.
- A question-generation step produces interview questions.
- That output then feeds the chat experience, which answers with the research context as grounding.
5. External AI/search dependencies
- Gemini is the main LLM used for synthesis, question generation, and chat responses.
- Tavily is the external search service used to gather fresh web evidence.
- LangSmith is optional and only affects observability/tracing, not the core product behavior.
6. State, persistence, and session boundaries
- LangGraph checkpointing via SqliteSaver is a major architectural boundary: it makes multi-step runs resumable and allows thread/session isolation.
- The app also persists user preferences locally in .pp_settings.json.
- The README notes limited long-term memory; the current design is primarily session-local rather than account-based.
7. UI structure
- The web UI is split by user task:
- Research: run the company prep pipeline
- Chat: ask questions grounded in prior research
- My Companies: browse saved research
- Progress: readiness metrics and charts
- Settings: API key and preference state
- Templates are centralized under webapp/templates/ with shared layout in base.html, and client-side behavior lives in webapp/static/js/app.js.
8. Supporting modules and learning progression
- week1/ through week4/ contain earlier-stage experiments: raw chat, chain composition, memory, embeddings, ChromaDB, RAG, and agent patterns.
- week5/ is where the app becomes a cohesive product with structured outputs, error handling, and the main app.
- These folders are mostly educational/prototyping layers that inform the final architecture, rather than separate runtime subsystems.
9. Local knowledge and retrieval pieces
- week3/ includes ChromaDB, DB inspection, import, and RAG-related modules, indicating a local vector-store/retrieval capability exists in the codebase.
- Even if not the main path in the README’s 4-node research flow, this layer is an architectural option for grounding responses in stored company notes or prior research.
10. Quality gates and resilience
- week6/ contains unit tests, integration tests, logging, and audit code.
- The tests emphasize graph shape, node order, mocked external APIs, checkpoint persistence, thread isolation, interrupt/resume behavior, and error recovery.
- This means the architecture explicitly separates deterministic orchestration from nondeterministic API calls.
11. Deployment and packaging
- Dockerfile and docker-compose.yml define containerized local execution.
- GitHub Actions workflows cover CI, tests, and deployment automation.
- This implies the app is designed to run as a single-process service with external API dependencies, rather than a multi-service backend.
12. Operational boundary summary
- The main production boundary is: browser or CLI input → LangGraph orchestration → Gemini/Tavily external calls → checkpointed state → web UI / chat output.
- Everything else in the repo supports that path: earlier week folders demonstrate evolution, tests validate it, and Docker/CI make it runnable and shippable.
Main entry points: day34_35_app.py LangGraph app · app.py Web app · utils.py Shared utils · day37_unit_tests.py Tests
Components 21
Runtime surfaces
Primary entrypoints and user-facing interfaces
- CLI · Command-line entrypoint for setup checks, research runs, tests, and launching the app
main.py - Web app · Browser-facing application layer coordinating research, chat, history, progress, and settings
webapp/app.py - Templates · Shared HTML views for the browser interface
webapp/templates - Client JS · Browser behavior and UI interactions
webapp/static/js/app.js
Core app
LangGraph orchestration and checkpointed state
- LangGraph app · Main research pipeline built around typed state and checkpointed execution
week5/day34_35_app.py - Research state · Central state object flowing through the pipeline with partial updates
week5/day34_35_app.py - Metadata · Extracts company facts and basic context from the user request
week5/day34_35_app.py - Web search · Fetches fresh evidence from Tavily
week5/day34_35_app.py - Briefing · Condenses research findings into a short prep summary
week5/day34_35_app.py - Questions · Generates tailored interview questions from the synthesized context
week5/day34_35_app.py - Chat grounding · Answers user questions using the accumulated research context
week5/day34_35_app.py
Support systems
Retrieval, persistence, and shared helpers
- Checkpointing · Resumable thread-local state storage via LangGraph checkpointing
week4/day27_28_persistence.py - Local settings · Persists user preferences and API-related local configuration
- Vector store · Local ChromaDB and RAG support for stored notes and prior research
week3/day16_chromadb.py - Shared utils · Common utility functions used across the repo
src/utils.py
Quality and ops
Testing, logging, deployment, and CI
- Tests · Unit, integration, persistence, interrupt/resume, and graph-shape validation
week6/day37_unit_tests.py - Observability · Logging, audit trails, and run inspection support
week6/day36_audit.py - CI/CD · GitHub Actions workflows for tests, CI, and deployment
.github/workflows/ci.yml - Containers · Docker and compose definitions for local and packaged execution
Dockerfile
Learning progression
Earlier week exercises that feed the final app
- Earlier labs · Progression of chat, tools, memory, RAG, agent, and graph experiments
week1 - App design · Design, supervisor, structured outputs, error handling, and LangSmith instrumentation
week5/day29_design.py
Connections 22
- CLI → LangGraph app: launches · CLI starts or exercises the main LangGraph app
- Web app → LangGraph app: invokes · Web requests trigger the core research workflow
- Web app → Templates: renders · Server uses templates for browser pages
- Web app → Client JS: serves · Client-side interaction assets support the UI
- LangGraph app → Research state: reads/writes · Workflow nodes consume and return partial state updates
- LangGraph app → Metadata: starts with · Pipeline begins with company metadata extraction
- Metadata → Web search: feeds · Metadata informs search queries and evidence gathering
- Web search → Briefing: feeds · Collected snippets are summarized into a briefing
- Briefing → Questions: feeds · Briefing context drives tailored question generation
- Questions → Chat grounding: grounds · Generated prep context supports follow-up chat answers
- LangGraph app → Checkpointing: persists · Checkpointing makes multi-step runs resumable and isolated
- Web app → Checkpointing: resumes · UI sessions can continue stored runs
- Web app → Local settings: loads/saves · Preferences and API key state are stored locally
- LangGraph app → Vector store: optionally uses · Local retrieval can augment grounding from stored research
- Earlier labs → App design: evolves into · Earlier exercises inform the final app design and orchestration
- App design → LangGraph app: shapes · Design, structure, and error handling feed the production path
- Tests → LangGraph app: validates · Tests assert graph shape, node order, persistence, and recovery
- Observability → LangGraph app: observes · Logging and audit code track workflow behavior
- CI/CD → Tests: runs · CI executes the test and verification pipeline
- Containers → Web app: packages · Container setup packages the app for local or deployed execution
- Shared utils → Web app: supports · Shared utilities are reused by runtime components
- Shared utils → LangGraph app: supports · Shared utilities also support orchestration code