jevcrawl 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. jevcrawl-0.1.0/.gitignore +13 -0
  2. jevcrawl-0.1.0/LICENSE +202 -0
  3. jevcrawl-0.1.0/PKG-INFO +271 -0
  4. jevcrawl-0.1.0/README.md +240 -0
  5. jevcrawl-0.1.0/SECURITY.md +9 -0
  6. jevcrawl-0.1.0/bench/README.md +96 -0
  7. jevcrawl-0.1.0/bench/__init__.py +0 -0
  8. jevcrawl-0.1.0/bench/baselines/__init__.py +10 -0
  9. jevcrawl-0.1.0/bench/baselines/bfs.py +53 -0
  10. jevcrawl-0.1.0/bench/baselines/common.py +133 -0
  11. jevcrawl-0.1.0/bench/baselines/crawl4ai_sys.py +50 -0
  12. jevcrawl-0.1.0/bench/baselines/jevcrawl_sys.py +51 -0
  13. jevcrawl-0.1.0/bench/baselines/llm_nav.py +84 -0
  14. jevcrawl-0.1.0/bench/config.toml +50 -0
  15. jevcrawl-0.1.0/bench/judge.py +57 -0
  16. jevcrawl-0.1.0/bench/llm.py +257 -0
  17. jevcrawl-0.1.0/bench/reach.py +107 -0
  18. jevcrawl-0.1.0/bench/report.py +120 -0
  19. jevcrawl-0.1.0/bench/report.smoke.md +14 -0
  20. jevcrawl-0.1.0/bench/run.py +208 -0
  21. jevcrawl-0.1.0/bench/tasks/__init__.py +0 -0
  22. jevcrawl-0.1.0/bench/tasks/loader.py +85 -0
  23. jevcrawl-0.1.0/bench/tasks/seen-ids.txt +53 -0
  24. jevcrawl-0.1.0/bench/tasks/verify.py +151 -0
  25. jevcrawl-0.1.0/bench/tasks/webwalkerqa.py +41 -0
  26. jevcrawl-0.1.0/bench/tune-report.smoke.md +13 -0
  27. jevcrawl-0.1.0/jevcrawl/__init__.py +6 -0
  28. jevcrawl-0.1.0/jevcrawl/cli.py +159 -0
  29. jevcrawl-0.1.0/jevcrawl/config.py +63 -0
  30. jevcrawl-0.1.0/jevcrawl/crawl/__init__.py +8 -0
  31. jevcrawl-0.1.0/jevcrawl/crawl/errors.py +22 -0
  32. jevcrawl-0.1.0/jevcrawl/crawl/frontier.py +98 -0
  33. jevcrawl-0.1.0/jevcrawl/crawl/loop.py +452 -0
  34. jevcrawl-0.1.0/jevcrawl/crawl/map.py +33 -0
  35. jevcrawl-0.1.0/jevcrawl/crawl/pack.py +52 -0
  36. jevcrawl-0.1.0/jevcrawl/crawl/scrape.py +74 -0
  37. jevcrawl-0.1.0/jevcrawl/crawl/sitemap.py +123 -0
  38. jevcrawl-0.1.0/jevcrawl/crawl/stop.py +33 -0
  39. jevcrawl-0.1.0/jevcrawl/decide/__init__.py +1 -0
  40. jevcrawl-0.1.0/jevcrawl/decide/cache.py +57 -0
  41. jevcrawl-0.1.0/jevcrawl/decide/client.py +209 -0
  42. jevcrawl-0.1.0/jevcrawl/decide/cost.py +38 -0
  43. jevcrawl-0.1.0/jevcrawl/decide/decider.py +228 -0
  44. jevcrawl-0.1.0/jevcrawl/decide/packing.py +67 -0
  45. jevcrawl-0.1.0/jevcrawl/decide/questions.py +126 -0
  46. jevcrawl-0.1.0/jevcrawl/doctor.py +38 -0
  47. jevcrawl-0.1.0/jevcrawl/fetch/__init__.py +1 -0
  48. jevcrawl-0.1.0/jevcrawl/fetch/http.py +120 -0
  49. jevcrawl-0.1.0/jevcrawl/fetch/jsdetect.py +37 -0
  50. jevcrawl-0.1.0/jevcrawl/log.py +30 -0
  51. jevcrawl-0.1.0/jevcrawl/mcp_server.py +180 -0
  52. jevcrawl-0.1.0/jevcrawl/models.py +134 -0
  53. jevcrawl-0.1.0/jevcrawl/segment/__init__.py +1 -0
  54. jevcrawl-0.1.0/jevcrawl/segment/blocks.py +540 -0
  55. jevcrawl-0.1.0/jevcrawl/segment/boilerplate.py +70 -0
  56. jevcrawl-0.1.0/jevcrawl/segment/lang.py +22 -0
  57. jevcrawl-0.1.0/jevcrawl/segment/links.py +294 -0
  58. jevcrawl-0.1.0/pyproject.toml +96 -0
  59. jevcrawl-0.1.0/skills/jevcrawl/SKILL.md +53 -0
  60. jevcrawl-0.1.0/tests/__init__.py +0 -0
  61. jevcrawl-0.1.0/tests/conftest.py +34 -0
  62. jevcrawl-0.1.0/tests/fixtures/__init__.py +0 -0
  63. jevcrawl-0.1.0/tests/fixtures/bench_stubs.py +113 -0
  64. jevcrawl-0.1.0/tests/fixtures/fake_site.py +58 -0
  65. jevcrawl-0.1.0/tests/fixtures/jev_fake.py +120 -0
  66. jevcrawl-0.1.0/tests/fixtures/site/app.html +4 -0
  67. jevcrawl-0.1.0/tests/fixtures/site/files/size-guide.pdf +1 -0
  68. jevcrawl-0.1.0/tests/fixtures/site/help/returns.html +17 -0
  69. jevcrawl-0.1.0/tests/fixtures/site/help/shipping.html +14 -0
  70. jevcrawl-0.1.0/tests/fixtures/site/index.html +22 -0
  71. jevcrawl-0.1.0/tests/fixtures/site/jobs.html +13 -0
  72. jevcrawl-0.1.0/tests/fixtures/site/private/area.html +1 -0
  73. jevcrawl-0.1.0/tests/fixtures/site/robots.txt +2 -0
  74. jevcrawl-0.1.0/tests/test_bench.py +391 -0
  75. jevcrawl-0.1.0/tests/test_boilerplate.py +60 -0
  76. jevcrawl-0.1.0/tests/test_cli.py +96 -0
  77. jevcrawl-0.1.0/tests/test_config.py +34 -0
  78. jevcrawl-0.1.0/tests/test_crawl.py +473 -0
  79. jevcrawl-0.1.0/tests/test_decide.py +445 -0
  80. jevcrawl-0.1.0/tests/test_fetch.py +86 -0
  81. jevcrawl-0.1.0/tests/test_live.py +42 -0
  82. jevcrawl-0.1.0/tests/test_mcp.py +153 -0
  83. jevcrawl-0.1.0/tests/test_prefilter.py +136 -0
  84. jevcrawl-0.1.0/tests/test_segment.py +186 -0
  85. jevcrawl-0.1.0/tests/test_signals.py +49 -0
@@ -0,0 +1,13 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ .venv*/
4
+ .pytest_cache/
5
+ .ruff_cache/
6
+ .mypy_cache/
7
+ dist/
8
+ *.egg-info/
9
+ .env
10
+ bench/results/
11
+ # local planning documents, not part of the repo
12
+ *.docx
13
+ jevcrawl-claude-code-prompt.md
jevcrawl-0.1.0/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,271 @@
1
+ Metadata-Version: 2.5
2
+ Name: jevcrawl
3
+ Version: 0.1.0
4
+ Summary: MCP server and CLI that crawls websites for AI agents: a small decision model (Jev) picks the pages and passages, so the agent's LLM only reads what answers its question.
5
+ Project-URL: Homepage, https://github.com/RayenMlayeh/jevcrawl
6
+ Project-URL: Issues, https://github.com/RayenMlayeh/jevcrawl/issues
7
+ Author: Rayen Mlayeh
8
+ License-Expression: Apache-2.0
9
+ License-File: LICENSE
10
+ Keywords: ai-agents,jev,mcp,mcp-server,typesafe,web-crawler,web-scraping
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: Apache Software License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Topic :: Internet :: WWW/HTTP
19
+ Classifier: Typing :: Typed
20
+ Requires-Python: >=3.11
21
+ Requires-Dist: httpx[http2]>=0.27
22
+ Requires-Dist: mcp>=1.2
23
+ Requires-Dist: selectolax>=1.0
24
+ Requires-Dist: w3lib>=2.1
25
+ Provides-Extra: bench
26
+ Requires-Dist: anthropic; extra == 'bench'
27
+ Requires-Dist: datasets; extra == 'bench'
28
+ Provides-Extra: crawl4ai
29
+ Requires-Dist: crawl4ai; extra == 'crawl4ai'
30
+ Description-Content-Type: text/markdown
31
+
32
+ <div align="center">
33
+
34
+ <picture>
35
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/RayenMlayeh/jevcrawl/main/assets/logo-dark.svg">
36
+ <img alt="jevcrawl" src="https://raw.githubusercontent.com/RayenMlayeh/jevcrawl/main/assets/logo-light.svg" width="400">
37
+ </picture>
38
+
39
+ ### The web crawler for AI agents that finds the answer, not just pages.
40
+
41
+ A small decision model picks every link and every passage, so your agent's LLM reads
42
+ **only what answers its question** at **a few cents per crawl**.
43
+
44
+ [![PyPI](https://img.shields.io/pypi/v/jevcrawl?color=6D5DFC)](https://pypi.org/project/jevcrawl/)
45
+ [![CI](https://github.com/RayenMlayeh/jevcrawl/actions/workflows/ci.yml/badge.svg)](https://github.com/RayenMlayeh/jevcrawl/actions/workflows/ci.yml)
46
+ [![License](https://img.shields.io/badge/license-Apache--2.0-6D5DFC)](https://github.com/RayenMlayeh/jevcrawl/blob/main/LICENSE)
47
+ [![Python](https://img.shields.io/badge/python-3.11%2B-3776AB?logo=python&logoColor=white)](https://github.com/RayenMlayeh/jevcrawl/blob/main/pyproject.toml)
48
+ [![MCP server](https://img.shields.io/badge/MCP-server-22C3EE)](https://modelcontextprotocol.io)
49
+ [![Benchmark](https://img.shields.io/badge/WebWalkerQA-40%25_vs_30%25_for_Claude-6D5DFC)](#benchmarks)
50
+ [![Cost](https://img.shields.io/badge/cost-%240.025%2Ftask-2EA043)](#cost-and-privacy)
51
+
52
+ [Quick start](#quick-start) · [Benchmarks](#benchmarks) · [Tools](#tools) ·
53
+ [How it works](#how-it-works) · [Configuration](#configuration)
54
+
55
+ </div>
56
+
57
+ <br>
58
+
59
+ <p align="center">
60
+ <img alt="Demo: jevcrawl crawls docs.python.org for 'What does the walrus operator := do and which Python version added it?' and returns the What's New In Python 3.8 passage. 6 pages, 80,034 tokens reduced to 1,873, $0.0069, 8.3 seconds." src="https://raw.githubusercontent.com/RayenMlayeh/jevcrawl/main/assets/demo.svg" width="100%">
61
+ </p>
62
+
63
+ <picture>
64
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/RayenMlayeh/jevcrawl/main/assets/scoreboard-dark.svg">
65
+ <img alt="On 50 WebWalkerQA tasks jevcrawl answered 40% correctly and found the answer page 54% of the time for $0.025 per task, against 30%, 33% and $0.194 when Claude picks every link and 8%, 11% and $0.228 for a breadth-first crawl." src="https://raw.githubusercontent.com/RayenMlayeh/jevcrawl/main/assets/scoreboard-light.svg" width="100%">
66
+ </picture>
67
+
68
+ ## Why jevcrawl
69
+
70
+ Agents that browse a site have two bad options. They can **read everything** a crawler fetches,
71
+ which buries the answer in navigation and boilerplate and burns tokens. Or they can **let the LLM
72
+ pick each link**, which is slow and costs dollars per question. jevcrawl does neither:
73
+
74
+ - 🎯 **Finds the answer page more often.** 54% of tasks vs 33% when Claude picks the links, and
75
+ 2x as often as [Crawl4AI](#jevcrawl-vs-crawl4ai)'s goal-directed crawl.
76
+ - 💸 **About 8x cheaper per task, 10x per correct answer.** The crawl decisions cost about a cent.
77
+ - ⚡ **2x faster than an LLM-driven crawl.** Four pages at a time, one decision request per page.
78
+ - 📜 **Verbatim, with sources.** Every passage is copied from the page with its URL, heading path
79
+ and character offsets. The decision model only scores, so it cannot invent text.
80
+ - 🛡️ **Safe against prompt injection by design.** Page text is only ever scored, never followed.
81
+ - 🔌 **Works everywhere MCP does:** Claude Code, Claude Desktop, Cursor, or the CLI.
82
+
83
+ ## Quick start
84
+
85
+ You need a Jev API key from [console.typesafe.ai](https://console.typesafe.ai/) and
86
+ [uv](https://docs.astral.sh/uv/).
87
+
88
+ **Claude Code**
89
+
90
+ ```bash
91
+ claude mcp add jevcrawl -e TYPESAFE_API_KEY=<your key> -- uvx jevcrawl
92
+ ```
93
+
94
+ **Claude Desktop, Cursor and other MCP clients** (`mcpServers` in the client's config file)
95
+
96
+ ```json
97
+ {
98
+ "mcpServers": {
99
+ "jevcrawl": {
100
+ "command": "uvx",
101
+ "args": ["jevcrawl"],
102
+ "env": { "TYPESAFE_API_KEY": "<your key>" }
103
+ }
104
+ }
105
+ }
106
+ ```
107
+
108
+ Then ask your agent something like *"Use jevcrawl to find which Python version added the walrus
109
+ operator, starting from docs.python.org"*. Check the setup with
110
+ `uvx jevcrawl doctor`. Agents that load skills
111
+ can also use [`skills/jevcrawl/SKILL.md`](https://github.com/RayenMlayeh/jevcrawl/blob/main/skills/jevcrawl/SKILL.md).
112
+
113
+ ## Benchmarks
114
+
115
+ Every system starts on a site's home page with the same 30-page budget and the same question.
116
+ What each one collects goes to the **same answering LLM**, and the **same judge** grades the
117
+ answer, so the crawler is the only thing that changes.
118
+
119
+ <picture>
120
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/RayenMlayeh/jevcrawl/main/assets/cost-dark.svg">
121
+ <img alt="Cost of one correct answer: jevcrawl $0.06, Claude picking every link $0.65, breadth-first crawl $2.85." src="https://raw.githubusercontent.com/RayenMlayeh/jevcrawl/main/assets/cost-light.svg" width="100%">
122
+ </picture>
123
+
124
+ ### jevcrawl vs Crawl4AI
125
+
126
+ [Crawl4AI](https://github.com/unclecode/crawl4ai) is one of the most popular open-source crawlers
127
+ for LLMs. Its `BestFirstCrawlingStrategy` with a keyword scorer is its way to crawl toward a question
128
+ without an LLM, so we compared the two on whether they fetch the page that holds the answer.
129
+
130
+ <picture>
131
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/RayenMlayeh/jevcrawl/main/assets/crawl4ai-dark.svg">
132
+ <img alt="On 20 tasks jevcrawl found an answer page 10 times and Crawl4AI 5 times; every answer page 5 vs 2; median crawl time 29 s vs 43 s; sites that failed to load 0 vs 3. jevcrawl found 6 answer pages Crawl4AI missed, Crawl4AI found 1 jevcrawl missed." src="https://raw.githubusercontent.com/RayenMlayeh/jevcrawl/main/assets/crawl4ai-light.svg" width="100%">
133
+ </picture>
134
+
135
+ ### Where the numbers come from
136
+
137
+ | | |
138
+ |---|---|
139
+ | **Tasks** | [WebWalkerQA](https://huggingface.co/datasets/callanwu/WebWalkerQA) from *WebWalker: Benchmarking LLMs in Web Traversal* (Wu et al., Alibaba Tongyi Lab, [ACL 2025](https://arxiv.org/abs/2501.07572)): questions whose answers sit several clicks deep in real websites (conferences, universities, organizations, games), in English and Chinese. |
140
+ | **Task selection** | Each task was re-checked live before the run: the site and answer page still load and still contain the reference answer. Tasks looked at while developing are excluded ([`bench/tasks/seen-ids.txt`](https://github.com/RayenMlayeh/jevcrawl/blob/main/bench/tasks/seen-ids.txt)). |
141
+ | **Accuracy run** | 50 tasks, 2026-10-12. Answering model `claude-opus-5-5`, judge `claude-sonnet-5-5`. |
142
+ | **Crawl4AI run** | 20 different tasks, 2026-10-13, Crawl4AI 0.9.4. Crawl only, no LLM: did the crawler fetch the gold page? In the accuracy run, whether a system fetched the gold page closely tracked whether it answered correctly. |
143
+ | **Baselines** | *Claude picks every link*: Claude reads each page and chooses the next link. *Breadth-first*: every page to depth 2. All systems share jevcrawl's fetcher and remove navigation and footers. |
144
+ | **Costs** | Jev cost is billed and exact. LLM costs are token counts at list price. |
145
+ | **Caveats** | 50 and 20 tasks are small samples: the cost gap is large and stable, the accuracy gap less so. Crawl4AI drives a real browser, jevcrawl does not run JavaScript. |
146
+
147
+ The benchmark code and how to reproduce every number: [`bench/`](https://github.com/RayenMlayeh/jevcrawl/blob/main/bench/README.md).
148
+
149
+ ## Tools
150
+
151
+ | Tool | Use it for |
152
+ |---|---|
153
+ | `crawl(goal, start_url, max_pages=30, max_seconds=120, return_tokens=4000, max_decision_usd=0.05)` | The answer may be several pages deep. Returns the relevant passages. |
154
+ | `scrape(url, goal=None)` | One known page. With a goal, only the relevant passages; without one, all content and no Jev call. |
155
+ | `map(start_url, goal, limit=50, max_pages=10)` | Ranked URLs only, to decide what to `scrape`. |
156
+
157
+ <details>
158
+ <summary><b>A real result</b> (docs.python.org, "What does the walrus operator := do and which Python version added it?")</summary>
159
+
160
+ ```json
161
+ {"blocks": [{"url": "https://docs.python.org/3/whatsnew/3.8.html",
162
+ "heading_path": "What’s New In Python 3.8 > New Features > Assignment expressions",
163
+ "text": "There is new syntax := that assigns values to variables as part of a larger expression. ...",
164
+ "char_start": 307, "char_end": 580, "relevance": 0.97}],
165
+ "uncertain": [],
166
+ "pages": [{"url": "https://docs.python.org/3/", "title": "3.15.0 Documentation", "lang": "en",
167
+ "text_sha256": "b624ce93..."}],
168
+ "stats": {"pages_fetched": 6, "tokens_raw": 80034, "tokens_returned": 1873, "jev_calls": 11,
169
+ "cache_hits": 0, "jev_input_tokens": 164139, "jev_cost_usd": 0.0069,
170
+ "model": "jev-1.13.0", "degraded": false, "degraded_reason": null,
171
+ "needs_js_urls": [], "stopped_because": "answered", "elapsed_seconds": 8.3}}
172
+ ```
173
+
174
+ Trimmed to one block and one page. 80,034 tokens of pages became 1,873 tokens of answer, for
175
+ $0.0069, in 8.3 seconds.
176
+
177
+ - `blocks` are the relevant passages, best first; `uncertain` are borderline ones worth reading
178
+ before concluding something is missing.
179
+ - `char_start`/`char_end` index into the page text whose sha256 is in `pages`, so a quote can be
180
+ checked later.
181
+ - `stopped_because` is `answered`, `frontier_empty`, `max_pages`, `max_seconds`, `budget` or
182
+ `auth_error`.
183
+ - Expected failures come back as `{"error": "<code>", "message": "<what to do>"}`; the tools
184
+ never raise into the agent's session.
185
+
186
+ </details>
187
+
188
+ The same operations work from the command line (`uv tool install jevcrawl` or
189
+ `pip install jevcrawl` puts `jevcrawl` on your path):
190
+
191
+ ```bash
192
+ jevcrawl crawl https://docs.python.org/3/ --goal "What does the walrus operator do?" [--json]
193
+ jevcrawl scrape https://example.com/help/returns [--goal "..."] [--json]
194
+ jevcrawl map https://example.com --goal "..." [--limit 20]
195
+ jevcrawl doctor
196
+ ```
197
+
198
+ ## How it works
199
+
200
+ <picture>
201
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/RayenMlayeh/jevcrawl/main/assets/how-dark.svg">
202
+ <img alt="A crawl in six steps: seed from the sitemap, fetch the best 4 pages, segment them into passages, filter boilerplate for free, Jev scores every passage and link in one request per page, Jev checks whether the kept passages answer the goal. If not, it follows the next best links. The docs.python.org example turned 80,034 tokens of pages into 1,873 tokens for $0.0069 in 8.3 s." src="https://raw.githubusercontent.com/RayenMlayeh/jevcrawl/main/assets/how-light.svg" width="100%">
203
+ </picture>
204
+
205
+ - **Jev decides, it does not write.** [Jev](https://typesafe.ai) returns a probability per
206
+ yes/no question, so it cannot produce text. Everything you get back is copied from the page.
207
+ - **Page text is data, never instructions.** It travels only in data fields of a question; every
208
+ question sentence is a fixed string written by jevcrawl. An injected "ignore previous
209
+ instructions" can at worst bias a score.
210
+ - **Links below the priority floor are kept in reserve**, not dropped, so a crawl never stops
211
+ early while it still has page budget.
212
+ - **Failures degrade, they do not hide.** After three failed Jev requests the crawl continues
213
+ breadth-first, returns every block unscored in `uncertain`, and sets `stats.degraded`.
214
+ - **Repeats are free.** Jev's answers are cached locally (`~/.jevcrawl/cache`), so the same goal
215
+ on the same pages costs nothing.
216
+
217
+ ## Configuration
218
+
219
+ | Environment variable | Meaning | Default |
220
+ |---|---|---|
221
+ | `TYPESAFE_API_KEY` | Jev API key (required) | none |
222
+ | `JEVCRAWL_BASE_URL` | Jev-compatible endpoint | `https://api.typesafe.ai` |
223
+ | `JEVCRAWL_MODEL` | model id | `jev-1.13.0` (pinned: thresholds are calibrated per version) |
224
+ | `JEVCRAWL_CACHE_DIR` | answer cache | `~/.jevcrawl/cache` |
225
+
226
+ Everything else (thresholds, links per page, concurrency) has a measured default in
227
+ [`jevcrawl/config.py`](https://github.com/RayenMlayeh/jevcrawl/blob/main/jevcrawl/config.py), and Python callers can pass their own `Config`.
228
+
229
+ ## Cost and privacy
230
+
231
+ Jev charges for input tokens only, $0.042 per million for `jev-1.13.0`; in the benchmark a crawl
232
+ cost $0.011 on average. `max_decision_usd` is a hard limit: a request that could pass it is never
233
+ sent, and the crawl stops with `budget`. Every result reports `jev_cost_usd`, and `tokens_raw`
234
+ (what a plain crawl would hand your LLM) against `tokens_returned`.
235
+
236
+ **Page text is sent to TypeSafe** (blocks, link labels and URLs) to be scored. The API key is
237
+ read from the environment and never written to disk or logs.
238
+
239
+ ## Crawling responsibly
240
+
241
+ jevcrawl does not read `robots.txt` and does not rate-limit itself beyond fetching four pages at
242
+ a time. You are responsible for the sites you crawl, their terms of service and the law that
243
+ applies to you. It never logs in, does not try to get past paywalls or CAPTCHAs, and does not
244
+ run JavaScript (pages that need it are listed in `stats.needs_js_urls`). Every call is bounded by
245
+ `max_pages`, `max_seconds`, `max_decision_usd` and `return_tokens`.
246
+
247
+ ## Contributing
248
+
249
+ ```bash
250
+ uv sync
251
+ uv run ruff check . && uv run ruff format --check . && uv run mypy --strict jevcrawl
252
+ uv run pytest # offline: all HTTP is mocked
253
+ TYPESAFE_API_KEY=... uv run pytest -m live -s # one tiny real request, a fraction of a cent
254
+ ```
255
+
256
+ Tests never touch the network or spend money; anything that does is marked `live`. The README
257
+ charts are drawn by [`assets/build.py`](https://github.com/RayenMlayeh/jevcrawl/blob/main/assets/build.py) from the measured numbers. Issues and
258
+ pull requests are welcome; please report security problems as described in
259
+ [SECURITY.md](https://github.com/RayenMlayeh/jevcrawl/blob/main/SECURITY.md).
260
+
261
+ ## Acknowledgments
262
+
263
+ - [WebWalkerQA](https://github.com/Alibaba-NLP/WebAgent) by Alibaba's Tongyi Lab, for a
264
+ benchmark of questions that really need crawling.
265
+ - [Crawl4AI](https://github.com/unclecode/crawl4ai), the baseline we measure against.
266
+ - [Model Context Protocol](https://modelcontextprotocol.io), [selectolax](https://github.com/rushter/selectolax)
267
+ and [httpx](https://www.python-httpx.org/).
268
+
269
+ ## License
270
+
271
+ [Apache-2.0](https://github.com/RayenMlayeh/jevcrawl/blob/main/LICENSE)