> ## Documentation Index
> Fetch the complete documentation index at: https://learn.nexudus.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AI FAQ Search

> Performs an AI-powered search across FAQs and returns a generated response.

# AI FAQ Search

Submits a natural language question and returns an AI-generated response based on the location's FAQ knowledge base. If a matching document was used, its ID and name are included in the response.

## Authentication

No authentication required.

## Request Body

<ParamField body="query" type="string" required>
  The natural language question to search for.
</ParamField>

## Response

<ResponseField name="AiResponse" type="object" required>
  The AI-generated response.
</ResponseField>

<ResponseField name="AiResponse.r" type="string" required>
  The generated answer text.
</ResponseField>

<ResponseField name="AiResponse.UsedDocumentId" type="number">
  ID of the FAQ document used to generate the answer, if applicable.
</ResponseField>

<ResponseField name="AiResponse.UsedDocumentName" type="string">
  Name of the FAQ document used, if applicable.
</ResponseField>

## Examples

### Search FAQs

```http theme={null}
POST /api/public/faqs/aiSearch
Content-Type: application/json

{
  "query": "What are the opening hours?"
}
```

```json theme={null}
{
  "AiResponse": {
    "r": "Our space is open Monday to Friday from 8am to 8pm, and Saturday from 9am to 5pm.",
    "UsedDocumentId": 15,
    "UsedDocumentName": "Opening Hours"
  }
}
```

## TypeScript Integration

```typescript theme={null}
import endpoints from '@/api/endpoints'

const result = await httpClient.post(endpoints.faqs.aiSearch().url, {
  query: 'What are the opening hours?',
})
```
