Metadata-Version: 2.5
Name: strands-asyntai
Version: 0.1.0
Summary: Asyntai tools for Strands Agents: give your agent a whole website's knowledge, chats and leads
Project-URL: Homepage, https://asyntai.com/documentation/integrations/strands/
Project-URL: Documentation, https://asyntai.com/documentation/integrations/strands/
Project-URL: Source, https://github.com/asyntai/strands-asyntai
Author-email: Asyntai <hello@asyntai.com>
License: MIT
License-File: LICENSE
Keywords: agents,asyntai,chatbot,leads,plugin,rag,strands,strands-agents,tools,website
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Requires-Dist: httpx>=0.27.0
Requires-Dist: strands-agents>=1.30.0
Provides-Extra: test
Requires-Dist: pytest>=8.0; extra == 'test'
Description-Content-Type: text/markdown

# strands-asyntai

[Strands Agents](https://strandsagents.com) tools for [Asyntai](https://asyntai.com), the AI chat agent for websites.

Point Asyntai at a website. It reads the pages, the product feed and the documents, and keeps them current. `AsyntaiPlugin` hands that knowledge to any Strands agent, together with the website's chats and leads. Your agent answers questions about a real business without you building or maintaining an index.

Full guide: [asyntai.com/documentation/integrations/strands](https://asyntai.com/documentation/integrations/strands/)

## Install

```bash
pip install strands-asyntai
```

## Set the key

Create an API key in the Asyntai dashboard under **Settings → API**. The API is available on the Starter plan and higher.

```bash
export ASYNTAI_API_KEY="your-key"
```

## Use it

```python
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.

## The tools

| Tool | What the agent can do | On by default |
| --- | --- | --- |
| `asyntai_ask_website` | Answer a question from the website: products, prices, stock, delivery, opening hours, policies, documentation. | Yes |
| `asyntai_list_websites` | List the website agents on the account, with their ids. | Yes |
| `asyntai_list_knowledge` | List the pages, texts and files the website agent knows. | Yes |
| `asyntai_get_leads` | Read the visitors who left an email address or a phone number. | Yes (`lead_tools`) |
| `asyntai_get_conversation` | Read the messages of one website chat. | Yes (`lead_tools`) |
| `asyntai_add_text` | Store a text so the website agent uses it in later answers. | No (`knowledge_tools`) |
| `asyntai_add_url` | Read a page into the knowledge base. | No (`knowledge_tools`) |

```python
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:

```python
from strands import Agent
from strands_asyntai import asyntai_tools

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

## 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.

## Requirements

Python 3.10 or higher and `strands-agents` 1.30 or higher.

## Tests

```bash
pip install -e ".[test]"
pytest
```

`tests/test_live.py` runs against a real Asyntai server when `ASYNTAI_LIVE_KEY` and `ASYNTAI_LIVE_URL` are set.

## License

MIT
