Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thanks for the quota-aware fallback design in
web_search: it made adding a backend a very small change.Description
Adds Outcrawl as a third web search backend in the
web_searchsystem tool, next to Tavily and Jina. Outcrawl is web infrastructure for AI agents; its search API (POST https://api.outcrawl.ai/v1/search, bearer key) returns title, URL and snippet for each hit, and the free plan includes credits every month.It joins the existing random pick between the metered backends, so it gets the same Redis cool-down on quota errors (402, 429 and the others in
_QUOTA_STATUS) and the same Gemini and Z.AI fallbacks. It is only used whenOUTCRAWL_API_KEYis set, so nothing changes for existing deployments.Type of Change
Changes Made
intentkit/core/system_tools/search_web.py:_search_outcrawl(JSON body{query, limit},Authorization: Bearer, quota statuses raise_QuotaError, other non-200 responses raiseToolException,hitsmapped to title, url and snippet),has_outcrawlin the backend pool and the "no backend configured" message, module docstring.intentkit/config/config.py:outcrawl_api_keyloaded fromOUTCRAWL_API_KEY..env.example:OUTCRAWL_API_KEY=and the comment above it.tests/core/test_system_tools.py:_set_search_keystakesoutcrawl; new tests for Outcrawl as the only backend, quota fallback to Jina with cool-down, response parsing, the 429 and 500 paths.Testing
From the repo root with
uv sync --frozenon Python 3.13:pytest tests/core/test_system_tools.py: 85 passed (the 5 new Outcrawl tests included).ruff format --checkandruff check: clean.basedpyright: 0 errors, 0 warnings.lint-imports: 1 kept, 0 broken.deptry .: no issues.pytest tests/core tests/config tests/tools --ignore=tests/core/test_pdf_url_fetcher.py: 1271 passed. 5 tests intest_image.pyandtest_origin_provider.pyfail because no OpenRouter key is set here, and 74 tests error because no PostgreSQL could be launched (test_pdf_url_fetcher.pycannot load a system library); none of those touch this change.I also ran one live search through
_search_outcrawlwith a real key (query "intentkit open source agent framework", limit 2): it returned the formatted result list with the repository as the first hit.Related Issue
None, this adds a backend.
Disclosure: I work on Outcrawl.
This change was prepared with AI assistance (omp with Claude): the code, tests and this description were written with it, and the commands above were run as part of preparing it.