{
  "id": "search-tools",
  "title": "Redis search tools",
  "url": "https://redis.io/docs/latest/integrate/google-adk/search-tools/",
  "summary": "Vector, hybrid, text, and range search tools for Google ADK agents.",
  "tags": [
    "docs",
    "integrate",
    "oss",
    "rs",
    "rc"
  ],
  "last_updated": "2026-04-15T13:31:09-05:00",
  "page_type": "content",
  "content_hash": "e24aa56780add0180795f87e5204d638893230398952b0568aa229f5cdc59904",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "adk-redis provides four search tools that wrap [RedisVL]() query types into ADK-compatible tools. The LLM sees each tool as a callable function with a `query` parameter and gets back structured results."
    },
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "| Tool | Query type | Use case |\n|------|-----------|----------|\n| `RedisVectorSearchTool` | KNN vector similarity | Conceptual/semantic queries |\n| `RedisHybridSearchTool` | Vector + BM25 | Queries with specific terms + concepts |\n| `RedisTextSearchTool` | BM25 keyword | Exact terms, error messages, IDs |\n| `RedisRangeSearchTool` | Distance threshold | Exhaustive retrieval within a radius |"
    },
    {
      "id": "vector-search",
      "title": "Vector search",
      "role": "content",
      "text": "Embeds the query using a vectorizer and performs K-nearest-neighbor search.\n\n[code example]"
    },
    {
      "id": "hybrid-search",
      "title": "Hybrid search",
      "role": "content",
      "text": "Combines vector similarity with BM25 keyword matching. Auto-detects whether your Redis server supports native hybrid search (Redis 8.4+ with RedisVL 0.13+). Falls back to client-side aggregation if not.\n\n[code example]"
    },
    {
      "id": "text-search",
      "title": "Text search",
      "role": "content",
      "text": "Pure BM25 keyword search. No embeddings or vectorizer needed.\n\n[code example]"
    },
    {
      "id": "range-search",
      "title": "Range search",
      "role": "content",
      "text": "Returns all documents within a distance threshold instead of top-K. Useful for exhaustive retrieval.\n\n[code example]"
    },
    {
      "id": "multi-tool-agent",
      "title": "Multi-tool agent",
      "role": "content",
      "text": "Wire multiple search tools into a single agent and let the LLM choose the right one:\n\n[code example]\n\nThe `name` and `description` on each tool matter: the LLM reads them to decide which tool to call and when. Specific descriptions like \"Find products by semantic similarity\" work better than generic ones like \"search documents\"."
    },
    {
      "id": "more-info",
      "title": "More info",
      "role": "content",
      "text": "- [redis_search_tools example](https://github.com/redis-developer/adk-redis/tree/main/examples/redis_search_tools): All four search tools with a product catalog\n- [RedisVL documentation]()"
    }
  ],
  "examples": [
    {
      "id": "vector-search-ex0",
      "language": "python",
      "code": "from redisvl.index import SearchIndex\nfrom redisvl.utils.vectorize import HFTextVectorizer\nfrom adk_redis import RedisVectorSearchTool, RedisVectorQueryConfig\n\nvectorizer = HFTextVectorizer(model=\"redis/langcache-embed-v2\")\nindex = SearchIndex.from_existing(\"products\", redis_url=\"redis://localhost:6379\")\n\nvector_tool = RedisVectorSearchTool(\n    index=index,\n    vectorizer=vectorizer,\n    config=RedisVectorQueryConfig(num_results=5),\n    return_fields=[\"name\", \"description\", \"price\"],\n    name=\"search_products\",\n    description=\"Find products by semantic similarity.\",\n)",
      "section_id": "vector-search"
    },
    {
      "id": "hybrid-search-ex0",
      "language": "python",
      "code": "from adk_redis import RedisHybridSearchTool, RedisHybridQueryConfig\n\nhybrid_tool = RedisHybridSearchTool(\n    index=index,\n    vectorizer=vectorizer,\n    config=RedisHybridQueryConfig(\n        text_field_name=\"content\",\n        combination_method=\"LINEAR\",\n        linear_alpha=0.7,\n    ),\n    name=\"search_docs\",\n    description=\"Search documents using semantic and keyword matching.\",\n)",
      "section_id": "hybrid-search"
    },
    {
      "id": "text-search-ex0",
      "language": "python",
      "code": "from adk_redis import RedisTextSearchTool, RedisTextQueryConfig\n\ntext_tool = RedisTextSearchTool(\n    index=index,\n    config=RedisTextQueryConfig(\n        text_field_name=\"content\",\n        text_scorer=\"BM25STD\",\n    ),\n    return_fields=[\"title\", \"content\"],\n    name=\"keyword_search\",\n    description=\"Search for exact terms and phrases.\",\n)",
      "section_id": "text-search"
    },
    {
      "id": "range-search-ex0",
      "language": "python",
      "code": "from adk_redis import RedisRangeSearchTool, RedisRangeQueryConfig\n\nrange_tool = RedisRangeSearchTool(\n    index=index,\n    vectorizer=vectorizer,\n    config=RedisRangeQueryConfig(distance_threshold=0.5),\n    return_fields=[\"title\", \"content\"],\n    name=\"range_search\",\n    description=\"Find all documents within a semantic distance threshold.\",\n)",
      "section_id": "range-search"
    },
    {
      "id": "multi-tool-agent-ex0",
      "language": "python",
      "code": "from google.adk import Agent\n\nagent = Agent(\n    model=\"gemini-2.5-flash\",\n    name=\"search_agent\",\n    instruction=(\n        \"You have three search tools. Use search_products for conceptual \"\n        \"queries, keyword_search for exact terms, range_search for \"\n        \"exhaustive retrieval.\"\n    ),\n    tools=[vector_tool, text_tool, range_tool],\n)",
      "section_id": "multi-tool-agent"
    }
  ]
}
