-
Notifications
You must be signed in to change notification settings - Fork 493
Add Airweave Search Tool #483
base: main
Are you sure you want to change the base?
Conversation
- Introduced AirweaveAdvancedSearchTool and AirweaveSearchTool to the tools module. - Added airweave-sdk dependency in pyproject.toml.
- Updated offset parameter handling to remove unnecessary conditional checks in AirweaveAdvancedSearchTool and AirweaveSearchTool. - Adjusted recency_bias parameter to accept values directly without conditions.
- Added framework name and version to client initialization in AirweaveAdvancedSearchTool and AirweaveSearchTool. - Implemented safe retrieval of package version using importlib.metadata, defaulting to "unknown" if not available.
| return "No results found for your query." | ||
|
|
||
| if response.status == "no_relevant_results": | ||
| return "Search completed but no sufficiently relevant results were found." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Async Methods Lack Useful Error Guidance
The async _arun methods in both Airweave search tools return less helpful error messages than their sync _run counterparts. When no AI completion or relevant results are found, the async messages omit suggestions for next steps, like rephrasing the query or adjusting search parameters.
Additional Locations (2)
| offset=offset, | ||
| response_type=response_type, | ||
| recency_bias=recency_bias | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Airweave SDK Parameter Validation Mismatch
The AirweaveSearchTool's _run and _arun methods consistently pass default values of recency_bias=0.0 and offset=0 to the Airweave SDK. However, the current tests incorrectly assert that recency_bias is None and offset is omitted when these parameters are not explicitly provided, leading to a mismatch in validation.
Summary
Adds two new tools for searching across connected data sources via Airweave:
AirweaveSearchTool- Basic semantic searchAirweaveAdvancedSearchTool- Advanced search with filtering and AI rerankingWhat is Airweave?
Open-source platform providing unified search across 50+ data sources (Stripe, GitHub, Notion, Slack, etc.) with semantic search capabilities.
Changes
crewai_tools/tools/airweave_tool/with both toolsairweave-sdkto optional dependenciesImplementation
search()andsearch_advanced())_run()and_arun())Testing
All 18 tests passing. No linting errors.
Related Issue
Closes issue #482