Back to Dashboard

Documentation

Learn how to use Asyntai

Strands Agents Integration

Give your Strands agent the knowledge, chats and leads of a whole website

Create Account

Overview

Strands Agents is an open source Python SDK for building AI agents. The strands-asyntai package adds one plugin, AsyntaiPlugin, that gives those agents a real website to draw on.

Point Asyntai at a domain. Asyntai reads the pages, the product feed and the documents, and keeps them current. Your agent then asks that website a question and gets the answer a visitor would get, built from the real pages and the real prices. You build and maintain no index.

The same plugin opens the other side of the website: the chats visitors had, and the email addresses and phone numbers they left.

Tools

The plugin adds these tools to your agent:

  • asyntai_ask_website: answers a question from the website's pages, products and knowledge base.
  • asyntai_list_websites: lists the website agents on your account, with their ids.
  • asyntai_list_knowledge: lists what the website agent knows.
  • asyntai_get_leads: returns visitors who left an email address or a phone number, newest first.
  • asyntai_get_conversation: returns the messages of one website chat.
  • asyntai_add_text and asyntai_add_url: store a text or read a page into the knowledge base. Turn these on with knowledge_tools=True.

Requirements

  • Python 3.10 or higher
  • Strands Agents 1.30 or higher
  • An Asyntai account on the Starter plan or higher, because the plugin uses the Asyntai API

Installation

Follow these steps to add Asyntai to a Strands agent:

1

Install the Package

pip install strands-asyntai
2

Get Your API Key

Sign in to Asyntai, open Settings, then API, and copy your API key.

3

Set the Key

Put the key in the ASYNTAI_API_KEY environment variable, or pass it as the first argument of the plugin.

4

Add the Plugin

Pass AsyntaiPlugin() to your agent's plugins.

Example

from strands import Agent
from strands_asyntai import AsyntaiPlugin

agent = Agent(plugins=[AsyntaiPlugin()])

agent("Do they ship to Spain, and how long does it take?")

The questions of one plugin instance share one website conversation, so follow-up questions keep their context. To continue a conversation later, for example one per customer, pass session_id="customer-42". Every conversation also shows in your Asyntai chat logs.

Options

AsyntaiPlugin(
    website_id=42,          # which website agent, when the account has several
    lead_tools=False,       # hide visitor contact details and chats
    knowledge_tools=True,   # allow writing to the knowledge base
)

Use the Tools Without the Plugin

asyntai_tools() takes the same arguments and returns a plain list, so you can mix the tools with your own:

from strands import Agent
from strands_asyntai import asyntai_tools

agent = Agent(tools=[*asyntai_tools(lead_tools=False), my_other_tool])

Tip: The answer quality follows the knowledge base. Add the pages that matter in the Asyntai dashboard, or with asyntai_add_url, and check the result with asyntai_list_knowledge.

Errors

A failed call reaches the model as a tool error with a clear message, for example a wrong API key or a wrong website_id. The model can then correct the call or explain the problem to the user.

Plans & Pricing

The package is free. It uses the Asyntai API, which needs the Starter plan or higher. View pricing.

Need Help?

If you have any questions or run into issues, contact us at [email protected].