AgentOps makes monitoring your Haystack agents seamless. Haystack, much like AutoGen, is a flexible framework that supports multiple models. For detailed installation instructions and feature overviews, refer to the Haystack documentation.

Integrating AgentOps with Haystack

1

Install the AgentOps SDK

pip install agentops
2

Install Haystack

We currently only support Haystack 2.x.

pip install haystack-ai
3

Configure your environment

Set your API key as an .env variable for easy access.

AGENTOPS_API_KEY=<YOUR API KEY>

Read more about environment variables in Advanced Configuration

4

Add 3 lines of code

Make sure to call agentops.init before calling any openai, cohere, crew, etc models.

import agentops
agentops.init(<INSERT YOUR API KEY HERE>)
...
# End of program (e.g. main.py)
agentops.end_session("Success") # Success|Fail|Indeterminate
5

Run your agent

Execute your script and then visit app.agentops.ai/drilldown to monitor your Haystack agent in action. šŸ•µļø

After execution, AgentOps outputs a clickable URL in the console that links directly to your session in the Dashboard.

Clickable link to session

Full Examples

You can refer to the following examples -