# Algolia

The **Algolia Node** in Stack AI allows you to search your Algolia index using natural language or semantic queries. This integration is ideal for retrieving relevant data, documents, or records from your Algolia-powered search infrastructure directly within your AI workflows.

***

## How to use it?

Add the Algolia node to your Stack AI workflow to execute search queries against your Algolia index. Connect an input node or LLM node to provide the search query, and use the results in downstream nodes for further processing or display.

***

## Example of Usage

Suppose you want to search for documentation related to "API authentication" in your Algolia index. You would connect an input node (where the user types their query) to the Algolia node, and the Algolia node will return the most relevant results.

***

## Available Actions

### 1. Database Query (Algolia Search)

**Description:**\
Executes a search query against your Algolia index and returns matching results.

***

#### Inputs

| Name  | Type   | Required | Description                                            | Example                                                                             |
| ----- | ------ | -------- | ------------------------------------------------------ | ----------------------------------------------------------------------------------- |
| Query | String | Yes      | The search query to execute against the Algolia index. | "how to implement authentication" ,, "database optimization" ,, "api documentation" |

Showing 1-1 of 1 items

**Example Input:**

```json
{
  "query": "api documentation"
}
```

***

#### Configurations

There are no additional configuration parameters required for the Algolia Database Query action. All you need is the search query input.

***

#### Outputs

| Name    | Type   | Required | Description                                     | Example                                           |
| ------- | ------ | -------- | ----------------------------------------------- | ------------------------------------------------- |
| Results | String | Yes      | The search results from Algolia in JSON format. | '\[{"title": "API Docs", "url": "https\://..."}]' |

Showing 1-1 of 1 items

**Example Output:**

```json
{
  "results": [
    {
      "title": "API Docs",
      "url": "https://docs.example.com/api"
    },
    {
      "title": "Authentication Guide",
      "url": "https://docs.example.com/auth"
    }
  ]
}

```

***

## Summary Table

| Action Name    | Required Inputs | Configurations | Outputs                |
| -------------- | --------------- | -------------- | ---------------------- |
| Database Query | Query (string)  | None           | Results (string, JSON) |
