> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.airweave.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.airweave.ai/_mcp/server.

# Agentic Search

POST https://api.airweave.ai/collections/{readable_id}/search/agentic
Content-Type: application/json

Agent that iteratively searches, reads, navigates hierarchies, and collects results.

Reference: https://docs.airweave.ai/api-reference/collections/agentic

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: API
  version: 1.0.0
paths:
  /collections/{readable_id}/search/agentic:
    post:
      operationId: agentic
      summary: Agentic Search
      description: >-
        Agent that iteratively searches, reads, navigates hierarchies, and
        collects results.
      tags:
        - collections > search
      parameters:
        - name: readable_id
          in: path
          required: true
          schema:
            type: string
        - name: x-api-key
          in: header
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchV2Response'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AgenticSearchRequest'
servers:
  - url: https://api.airweave.ai
    description: Production
  - url: http://localhost:8001
    description: Local
components:
  schemas:
    FilterableField:
      type: string
      enum:
        - entity_id
        - name
        - created_at
        - updated_at
        - breadcrumbs.entity_id
        - breadcrumbs.name
        - breadcrumbs.entity_type
        - airweave_system_metadata.entity_type
        - airweave_system_metadata.source_name
        - airweave_system_metadata.original_entity_id
        - airweave_system_metadata.chunk_index
        - airweave_system_metadata.sync_id
        - airweave_system_metadata.sync_job_id
      description: |-
        Filterable fields in search.

        Uses dot notation for nested fields (e.g., breadcrumbs.name,
        airweave_system_metadata.source_name).
      title: FilterableField
    FilterOperator:
      type: string
      enum:
        - equals
        - not_equals
        - contains
        - greater_than
        - less_than
        - greater_than_or_equal
        - less_than_or_equal
        - in
        - not_in
      description: Supported filter operators.
      title: FilterOperator
    FilterConditionValue:
      oneOf:
        - type: string
        - type: integer
        - type: boolean
        - type: array
          items:
            type: string
        - type: array
          items:
            type: integer
      description: Value to compare against. Use a list for 'in' and 'not_in' operators.
      title: FilterConditionValue
    FilterCondition:
      type: object
      properties:
        field:
          $ref: '#/components/schemas/FilterableField'
          description: Field to filter on (use dot notation for nested fields).
        operator:
          $ref: '#/components/schemas/FilterOperator'
          description: The comparison operator to use.
        value:
          $ref: '#/components/schemas/FilterConditionValue'
          description: >-
            Value to compare against. Use a list for 'in' and 'not_in'
            operators.
      required:
        - field
        - operator
        - value
      description: |-
        A single filter condition.

        Pydantic validates that:
        - ``field`` is a valid FilterableField enum value
        - ``operator`` is a valid FilterOperator enum value
        - ``value`` matches the expected types
        - The combination of field + operator + value is semantically valid

        Invalid filters raise ``pydantic.ValidationError`` automatically.

        Examples:
            {"field": "airweave_system_metadata.source_name", "operator": "equals",
             "value": "notion"}
            {"field": "created_at", "operator": "greater_than",
             "value": "2024-01-01T00:00:00Z"}
            {"field": "breadcrumbs.name", "operator": "contains", "value": "Engineering"}
      title: FilterCondition
    FilterGroup:
      type: object
      properties:
        conditions:
          type: array
          items:
            $ref: '#/components/schemas/FilterCondition'
          description: Filter conditions within this group, combined with AND
      required:
        - conditions
      description: |-
        A group of filter conditions combined with AND.

        Multiple filter groups are combined with OR, allowing expressions like:
        (A AND B) OR (C AND D)

        Examples:
            Single group (AND):
                {"conditions": [
                    {"field": "airweave_system_metadata.source_name",
                     "operator": "equals", "value": "slack"},
                    {"field": "airweave_system_metadata.entity_type",
                     "operator": "equals", "value": "SlackMessageEntity"}
                ]}

            Multiple groups (OR between groups, AND within):
                [
                    {"conditions": [{"field": "name", "operator": "equals",
                                     "value": "doc1"}]},
                    {"conditions": [{"field": "name", "operator": "equals",
                                     "value": "doc2"}]}
                ]

            Breadcrumb filtering:
                {"conditions": [
                    {"field": "breadcrumbs.name", "operator": "contains",
                     "value": "Engineering"}
                ]}
      title: FilterGroup
    AgenticSearchRequest:
      type: object
      properties:
        query:
          type: string
          description: Search query text.
        thinking:
          type: boolean
          default: false
          description: Enable extended thinking / chain-of-thought.
        filter:
          type:
            - array
            - 'null'
          items:
            $ref: '#/components/schemas/FilterGroup'
          description: Filter groups (combined with OR).
        limit:
          type:
            - integer
            - 'null'
          description: Max results. None means agent decides.
      required:
        - query
      description: Agentic search request — full agent loop with tool calling.
      title: AgenticSearchRequest
    SearchBreadcrumb:
      type: object
      properties:
        entity_id:
          type: string
          description: ID of the entity in the source.
        name:
          type: string
          description: Display name of the entity.
        entity_type:
          type: string
          description: Entity class name (e.g., 'AsanaProjectEntity').
      required:
        - entity_id
        - name
        - entity_type
      description: Breadcrumb in search result.
      title: SearchBreadcrumb
    SearchSystemMetadata:
      type: object
      properties:
        source_name:
          type: string
          description: Name of the source this entity belongs to.
        entity_type:
          type: string
          description: Type of the entity this entity represents in the source.
        sync_id:
          type:
            - string
            - 'null'
          description: ID of the sync this entity belongs to (None for federated).
        sync_job_id:
          type:
            - string
            - 'null'
          description: ID of the sync job this entity belongs to (None for federated).
        chunk_index:
          type: integer
          description: Index of the chunk in the file.
        original_entity_id:
          type: string
          description: Original entity ID
      required:
        - source_name
        - entity_type
        - chunk_index
        - original_entity_id
      description: System metadata in search result.
      title: SearchSystemMetadata
    SearchAccessControl:
      type: object
      properties:
        viewers:
          type:
            - array
            - 'null'
          items:
            type: string
          description: Principal IDs who can view this entity. None if unknown.
        is_public:
          type:
            - boolean
            - 'null'
          description: Whether this entity is publicly accessible. None if unknown.
      description: Access control in search result.
      title: SearchAccessControl
    SearchResult:
      type: object
      properties:
        entity_id:
          type: string
          description: Original entity ID.
        name:
          type: string
          description: Entity display name.
        relevance_score:
          type: number
          format: double
          description: Relevance score from the search engine.
        breadcrumbs:
          type: array
          items:
            $ref: '#/components/schemas/SearchBreadcrumb'
          description: Breadcrumbs showing entity hierarchy.
        created_at:
          type:
            - string
            - 'null'
          format: date-time
          description: When the entity was created.
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
          description: When the entity was last updated.
        textual_representation:
          type: string
          description: Semantically searchable text content
        airweave_system_metadata:
          $ref: '#/components/schemas/SearchSystemMetadata'
          description: System metadata
        access:
          $ref: '#/components/schemas/SearchAccessControl'
          description: Access control
        web_url:
          type: string
          description: >-
            URL to view the entity in its source application (e.g., Notion,
            Asana).
        url:
          type:
            - string
            - 'null'
          description: Download URL for file entities. Only present for FileEntity types.
        raw_source_fields:
          type: object
          additionalProperties:
            description: Any type
          description: All source-specific fields.
      required:
        - entity_id
        - name
        - relevance_score
        - breadcrumbs
        - textual_representation
        - airweave_system_metadata
        - access
        - web_url
        - raw_source_fields
      description: Search result.
      title: SearchResult
    SearchV2Response:
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/SearchResult'
          description: Search results ordered by relevance.
      description: Unified response for all search tiers.
      title: SearchV2Response
    ValidationErrorLocItems:
      oneOf:
        - type: string
        - type: integer
      title: ValidationErrorLocItems
    ValidationError:
      type: object
      properties:
        loc:
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorLocItems'
        msg:
          type: string
        type:
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
    HTTPValidationError:
      type: object
      properties:
        detail:
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
      title: HTTPValidationError
  securitySchemes:
    default:
      type: apiKey
      in: header
      name: x-api-key

```

## Examples



**Request**

```json
{
  "query": "find all deployment-related docs from last month",
  "thinking": true
}
```

**Response**

```json
{
  "results": [
    {
      "entity_id": "page-abc123",
      "name": "Production Deployment Guide",
      "relevance_score": 0.94,
      "breadcrumbs": [
        {
          "entity_id": "ws-1",
          "name": "Acme Workspace",
          "entity_type": "NotionWorkspaceEntity"
        },
        {
          "entity_id": "db-eng",
          "name": "Engineering",
          "entity_type": "NotionDatabaseEntity"
        }
      ],
      "textual_representation": "# Production Deployment Guide\n\nThis document covers the standard deployment process for production releases.",
      "airweave_system_metadata": {
        "source_name": "notion",
        "entity_type": "NotionPageEntity",
        "chunk_index": 0,
        "original_entity_id": "page-abc123",
        "sync_id": "d4e5f6a7-b8c9-4d0e-1f2a-3b4c5d6e7f80",
        "sync_job_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
      },
      "access": {
        "viewers": null,
        "is_public": null
      },
      "web_url": "https://notion.so/Deployment-Guide-abc123",
      "raw_source_fields": {
        "icon": "🚀",
        "archived": false,
        "parent_type": "database_id"
      },
      "created_at": "2025-02-10T09:15:00Z",
      "updated_at": "2025-03-18T16:30:00Z",
      "url": null
    },
    {
      "entity_id": "msg-def456",
      "name": "Deployment checklist update",
      "relevance_score": 0.87,
      "breadcrumbs": [
        {
          "entity_id": "team-1",
          "name": "Acme",
          "entity_type": "SlackWorkspaceEntity"
        },
        {
          "entity_id": "chan-eng",
          "name": "#engineering",
          "entity_type": "SlackChannelEntity"
        }
      ],
      "textual_representation": "Updated the deployment checklist to include the new canary step. Make sure to verify metrics before promoting to 100%.",
      "airweave_system_metadata": {
        "source_name": "slack",
        "entity_type": "SlackMessageEntity",
        "chunk_index": 0,
        "original_entity_id": "msg-def456",
        "sync_id": "e5f6a7b8-c9d0-4e1f-2a3b-4c5d6e7f8091",
        "sync_job_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901"
      },
      "access": {
        "viewers": null,
        "is_public": null
      },
      "web_url": "https://acme.slack.com/archives/C0123ABC/p1710500520",
      "raw_source_fields": {
        "channel_name": "#engineering",
        "username": "alice"
      },
      "created_at": "2025-03-15T11:22:00Z",
      "updated_at": "2025-03-15T11:22:00Z",
      "url": null
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.airweave.ai/collections/customer-support-tickets-x7k9m/search/agentic"

payload = {
    "query": "find all deployment-related docs from last month",
    "thinking": True
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.airweave.ai/collections/customer-support-tickets-x7k9m/search/agentic';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"query":"find all deployment-related docs from last month","thinking":true}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.airweave.ai/collections/customer-support-tickets-x7k9m/search/agentic"

	payload := strings.NewReader("{\n  \"query\": \"find all deployment-related docs from last month\",\n  \"thinking\": true\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.airweave.ai/collections/customer-support-tickets-x7k9m/search/agentic")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"query\": \"find all deployment-related docs from last month\",\n  \"thinking\": true\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.airweave.ai/collections/customer-support-tickets-x7k9m/search/agentic")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"query\": \"find all deployment-related docs from last month\",\n  \"thinking\": true\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.airweave.ai/collections/customer-support-tickets-x7k9m/search/agentic', [
  'body' => '{
  "query": "find all deployment-related docs from last month",
  "thinking": true
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.airweave.ai/collections/customer-support-tickets-x7k9m/search/agentic");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"query\": \"find all deployment-related docs from last month\",\n  \"thinking\": true\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "query": "find all deployment-related docs from last month",
  "thinking": true
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.airweave.ai/collections/customer-support-tickets-x7k9m/search/agentic")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```