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

# AgentStack

## Description

[Hyperspell](https://hyperspell.com) provides agents created with [AgentStack](https://agentstack.sh) with the ability to build and query internal knowledge using:

* Cross-source search across memories, emails, Notion, Gmail, Slack, and many other integrations
* Upload files and documents to create your agents' memory
* Answering questions requiring multiple documents

## Installation

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

Create your Hyperspell app and get your API key from the [Hyperspell Dashboard](https://app.hyperspell.com/dashboard).

Follow the instructions to connect your data sources

Set the environment variables in your project's `.env` file:

```env theme={null}
HYPERSPELL_API_KEY=your_api_key_here
```

<Note>
  Hyperspell is a multi-tenant platform, and you can separate your data by use by setting the user id of your end-user in a variable too:

  ```env theme={null}
  HYPERSPELL_USER_ID=your_user_id_here
  ```
</Note>

## Available Functions

The Hyperspell tool provides three core functions for knowledge retrieval and ingestion:

### Query memories

```python theme={null}
hyperspell_search(query, sources, answer=False, user_id=None)
```

Search across your Hyperspell-connected sources for relevant information.

**Parameters:**

<ParamField query="query" type="string" required>
  The search query to find relevant information
</ParamField>

<ParamField path="sources" type="string" required>
  Comma-separated list of sources to search (e.g., `vault,notion,gmail`)
</ParamField>

<ParamField path="answer" type="bool" default="False">
  If True, returns a direct AI answer instead of just documents. Defaults to False
</ParamField>

<ParamField path="user_id" type="string">
  User ID to use for this request. Defaults to `HYPERSPELL_USER_ID` env var
</ParamField>

### Add documents

```python theme={null}
hyperspell_add_document(text, title=None, user_id=None)
```

Add a text document to your Hyperspell knowledge base.

**Parameters:**

<ParamField path="text" type="string" required>
  The full text content to add
</ParamField>

<ParamField path="title" type="string" required>
  Optional title for the document
</ParamField>

<ParamField path="collection" type="string">
  Optional collection name to organize the document
</ParamField>

<ParamField path="user_id" type="string">
  User ID to use for this request. Defaults to `HYPERSPELL_USER_ID` env var
</ParamField>

### Upload files

```python theme={null}
hyperspell_upload_file(file_path, collection=None, user_id=None)
```

Upload a file (PDF, Word doc, spreadsheet, etc.) to your Hyperspell knowledge base.

**Parameters:**

<ParamField path="file_path" type="string" required>
  Path to the file to upload
</ParamField>

<ParamField path="collection" type="string">
  Optional collection name to organize the document
</ParamField>

<ParamField path="user_id" type="string">
  User ID to use for this request. Defaults to `HYPERSPELL_USER_ID` env var
</ParamField>

If no `user_id` is provided, the tool defaults to the `HYPERSPELL_USER_ID` environment variable.

## Integration Sources

Hyperspell can search across multiple integrated sources:

* **vault**: Your uploaded documents and added text
* **notion**: Connected Notion workspaces
* **gmail**: Connected Gmail accounts
* **slack**: Connected Slack workspaces
* **and many more**: Additional integrations available through the Hyperspell platform

For detailed integration setup, visit the [Hyperspell documentation](https://docs.hyperspell.com).
