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

# Perplexity

> Agentic Search

## Description

Perplexity AI is an AI-powered search engine that delivers concise, real-time answers to user queries by leveraging large language models (LLMs) and web data.
Information retrieval capabilities, providing up-to-date, contextually relevant responses.
This tool enables AI agents to offer more accurate and timely information, improving user interactions and decision-making processes.

Perplexity also cites sources within its responses that your agent can use to validate information.

## Installation

```bash theme={null}
agentstack tools add perplexity
```

Set the API key

```env theme={null}
PERPLEXITY_API_KEY=...
```

## Usage

Your agent will be able to write and read from memory. Prompt engineering may be required to instruct the agent when it is important to write and read.

Additionally, `mem0` allows for a `user_id` parameter as part of the tool's function call.

One option is to tell the agent to pass in the appropriate user\_id when calling the tool. Another option is to set the user\_id in this tool via code.
