Files
matchmaking-v2/research/poc/browser-apply/README.md
raulgupta 89ca9ad647 Initial commit: matchmaking-v2 on-demand multi-board job-search agent
On-demand Scout service (replaces the nightly aggregator):
- FastAPI agent-mesh service; card name "matchmaking-service" (HTTP /a2a/tasks
  + Redis-stream worker matching the sibling-service pattern)
- run_search: parallel multi-board sweep (Naukri/blackfalcondata + Foundit +
  LinkedIn), city-filtered at the board, cheapest-per-result first
- per-board adapters + normalizers -> ScoutJob with rich read-only details and
  offsite apply links; recall mode + MVQ guard
- result cache for dev replay ($0); per-board cost knobs; retry-on-5xx
- research/: engine design, board cost economics, India-actor shortlist, POC
2026-06-18 19:22:03 +05:30

78 lines
3.5 KiB
Markdown

# browser-apply — browser-use (open source) POC
The pivot away from heuristics. Instead of mocking an apply flow, an **AI agent drives a
real Chrome browser** — it looks at the page and clicks/types like a human. No cross-origin
wall, because it *is* the browser.
## The moving parts (what's actually running)
```
your task (plain English)
┌─────────┐ "what do I click next?" ┌──────────────┐
│ Agent │ ───────────────────────────────► │ OpenAI LLM │
│(browser-│ ◄─────────────────────────────── │ (the brain) │
│ use) │ "click element #3, type X" └──────────────┘
│ Chrome DevTools Protocol (cdp-use)
┌──────────────┐
│ real Chrome │ ← navigates, reads the page, clicks, types, uploads
└──────────────┘
```
- **browser-use** (v0.13.1) — the library. Runs the loop: screenshot/read page → ask the
LLM what to do → do it → repeat until the task is done.
- **The LLM** (OpenAI here) — the decision-maker. Sees the page, decides the next action.
It's swappable: OpenAI, Anthropic, Google, or local (Ollama).
- **Chrome** — your installed Google Chrome, driven over the DevTools Protocol. No separate
browser download needed. browser-use auto-adds ad/cookie-blocker extensions.
## Setup (already done once)
```bash
python3 -m venv venv # Python >= 3.11 (you have 3.13.2)
source venv/bin/activate
pip install browser-use # pulls openai/anthropic/google SDKs + cdp-use
# Chrome is reused from /Applications — nothing else to install
```
Secrets live in `.env` (git-ignored):
```
OPENAI_API_KEY=sk-...
```
## Run the smoke test
```bash
source venv/bin/activate
python verify.py # headless (no window)
HEADLESS=0 python verify.py # SEE Chrome open and the agent drive it
```
Expected: it visits example.com and prints `The main heading on the page is 'Example Domain'.`
## What's proven so far
- ✅ The full stack works: browser launches, LLM reasons, agent reads a live page (`verify.py`).
- ✅ Vision résumé parsing works on the real `Resume.pdf` (`parse_resume.py`).
## Real job-apply flow (built)
Applies to one real posting: LinkedIn job → hand-off to OpenAI's official job board → fill & submit.
| File | Role |
|---|---|
| `parse_resume.py` | Vision model (gpt-4o-mini + PyMuPDF) → structured `profile` from `Resume.pdf`. Mirrors resume-builder's `parse_service.py`. |
| `browser_config.py` | Shared `BrowserProfile` (dedicated `chrome-profile/`, real Chrome, visible) so login persists into apply. |
| `login_once.py` | One-time: open LinkedIn, you log in yourself, session saved. |
| `apply.py` | Parses résumé → drives the LinkedIn→OpenAI-board apply → auto-submits → structured result. |
```bash
source venv/bin/activate
python login_once.py # one time: log into LinkedIn in the window
python apply.py # parses résumé, applies, auto-submits
AUTO_SUBMIT=0 python apply.py # fill everything but STOP before submit (human review)
```
Honesty rules kept: a **liveness gate** (dead posting → report, never fake a submit), résumé is
the source of truth (no invented data), and auto-submit is one flag away from review-first.