You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 18dda0f
Browse filesBrowse the repository at this point in the historyBrowse files
This project implements a single-machine web crawler and keyword search engine with a live dashboard. It is designed to satisfy the assignment requirements around:
4
4
5
5
- indexing from an origin URL up to depth `k`,
@@ -65,7 +65,7 @@ The dashboard allows:
65
65
### Index/Search
66
66
67
67
-`POST /index`
68
-
Starts a new crawl job with origin URL, depth `k`, and optional initial rate limit.
68
+
Starts a new crawl job with origin URL, depth `k`, optional `max_urls_to_visit`, and optional initial rate limit.
Copy file name to clipboardExpand all lines: product_prd.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ Building search engines is usually out of reach for a single engineer, but AI-as
19
19
20
20
- Internet-scale crawling, cross-machine distribution, or strict guarantees about completeness of the web graph.
21
21
- Production-grade search relevance (no BM25, no learning-to-rank; a simple token-based heuristic is sufficient).
22
-
- Full politeness policies (robots.txt, per-domain rate scheduling); we only implement a global rate limiter.
22
+
- Full politeness policies (robots.txt, per-domain rate scheduling); the current implementation focuses on global queue limiting plus per-job rate controls.
23
23
- Strong security hardening (sandboxing, HTML sanitization) beyond what’s necessary for a localhost classroom demo.
24
24
25
25
#### User stories
@@ -30,15 +30,15 @@ Building search engines is usually out of reach for a single engineer, but AI-as
30
30
-**As a student**, I can monitor the dashboard to understand how queue depth, processed URL count, and backpressure state change over time as the crawler runs.
31
31
-**As a student**, I can restart the backend and immediately search previously indexed pages because they were persisted locally.
32
32
-**As a student**, I can open an Embeddings page, tune embedding speed/max pages, and monitor `% embedded` in real time.
33
-
-**As an instructor**, I can point at the dashboard and code to explain concurrency (worker pool, queue), backpressure (bounded queue), and uniqueness (visited set).
33
+
-**As an instructor**, I can point at the dashboard and code to explain concurrency (worker pool, queue), backpressure (global queue limit), and uniqueness (visited set).
34
34
35
35
#### Functional requirements
36
36
37
37
-**Index endpoint**
38
38
-`POST /index` accepts `{ origin: string, k: number }`.
39
39
- Spawns an asynchronous crawl job identified by `job_id`.
40
40
- Enforces depth limit `k` and “never crawl the same URL twice per job” using a normalized URL visited set.
41
-
- Applies global backpressure using a bounded `asyncio.Queue`and a fixed worker count; when the queue is full, link discovery pauses and `backpressure_state` transitions to `"queue_full"`.
41
+
- Applies global backpressure using a shared global queue limit and a fixed worker count; when the limit is reached, link discovery pauses and `backpressure_state` transitions to `"queue_full"`.
42
42
43
43
-**Search endpoint**
44
44
-`GET /search?query=...` returns a list of results, each containing `(relevant_url, origin_url, depth, score, title)`.
0 commit comments