Skip to content

Commit ca8863c

Browse files
authored
docs: add Haystack integration docs and links (#1233)
docs: add Haystack integration
1 parent 817f554 commit ca8863c

File tree

4 files changed

+90
-1
lines changed

4 files changed

+90
-1
lines changed

docs/mint.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@
144144
"v2/integrations/anthropic",
145145
"v2/integrations/autogen",
146146
"v2/integrations/crewai",
147+
"v2/integrations/haystack",
147148
"v2/integrations/google_adk",
148149
"v2/integrations/google_generative_ai",
149150
"v2/integrations/langchain",

docs/v2/examples/examples.mdx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ description: 'Examples of AgentOps with various integrations'
6060
Google Agent Development Kit integration
6161
</Card>
6262

63+
<Card title="Haystack" icon={<img src="https://www.github.com/agentops-ai/agentops/blob/main/docs/images/external/haystack/haystack-logo.png?raw=true" alt="Haystack" />} iconType="image" href="/v2/integrations/haystack">
64+
Monitor your Haystack agents with AgentOps
65+
</Card>
66+
6367
<Card title="OpenAI Agents SDK" icon={<img src="https://www.github.com/agentops-ai/agentops/blob/main/docs/images/external/openai/openai-logomark.png?raw=true" alt="OpenAI Agents SDK" />} iconType="image" href="/v2/examples/openai_agents">
6468
OpenAI Agents SDK workflow walkthrough
6569
</Card>
@@ -81,4 +85,4 @@ description: 'Examples of AgentOps with various integrations'
8185
<script type="module" src="/scripts/github_stars.js" />
8286
<script type="module" src="/scripts/scroll-img-fadein-animation.js" />
8387
<script type="module" src="/scripts/button_heartbeat_animation.js" />
84-
<script type="module" src="/scripts/adjust_api_dynamically.js" />
88+
<script type="module" src="/scripts/adjust_api_dynamically.js" />

docs/v2/integrations/haystack.mdx

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
---
2+
title: Haystack
3+
description: "Monitor your Haystack agents with AgentOps"
4+
---
5+
6+
[Haystack](https://docs.haystack.deepset.ai/docs/installation) is a flexible framework for building production-ready AI agents. AgentOps makes monitoring your Haystack agents seamless.
7+
8+
## Installation
9+
10+
<CodeGroup>
11+
```bash pip
12+
pip install agentops haystack-ai python-dotenv
13+
```
14+
```bash poetry
15+
poetry add agentops haystack-ai python-dotenv
16+
```
17+
```bash uv
18+
uv pip install agentops haystack-ai python-dotenv
19+
```
20+
</CodeGroup>
21+
22+
<Warning>
23+
We currently only support Haystack 2.x.
24+
</Warning>
25+
26+
## Setting Up API Keys
27+
28+
You'll need API keys for AgentOps and whatever model provider you use with Haystack (e.g. OpenAI):
29+
30+
- **AGENTOPS_API_KEY**: From your [AgentOps Dashboard](https://app.agentops.ai/)
31+
- **OPENAI_API_KEY**: From the [OpenAI Platform](https://platform.openai.com/api-keys) *(if using OpenAI models)*
32+
33+
Set these as environment variables or in a `.env` file.
34+
35+
<CodeGroup>
36+
```bash Export to CLI
37+
export AGENTOPS_API_KEY="your_agentops_api_key_here"
38+
export OPENAI_API_KEY="your_openai_api_key_here"
39+
```
40+
```txt Set in .env file
41+
AGENTOPS_API_KEY="your_agentops_api_key_here"
42+
OPENAI_API_KEY="your_openai_api_key_here"
43+
```
44+
</CodeGroup>
45+
46+
Then load them in your Python code:
47+
48+
```python
49+
from dotenv import load_dotenv
50+
import os
51+
52+
load_dotenv()
53+
AGENTOPS_API_KEY = os.getenv("AGENTOPS_API_KEY")
54+
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
55+
```
56+
57+
## Usage
58+
59+
Integrating AgentOps with Haystack only takes a few lines:
60+
61+
```python
62+
import agentops
63+
from haystack.components.generators.openai import OpenAIGenerator
64+
65+
agentops.init(AGENTOPS_API_KEY)
66+
67+
generator = OpenAIGenerator(model="gpt-4o-mini", api_key=OPENAI_API_KEY)
68+
result = generator.run(prompt="In one sentence, what is AgentOps?")
69+
print(result["replies"][0])
70+
```
71+
72+
Run your script and visit the [AgentOps Dashboard](https://app.agentops.ai/drilldown) to monitor the trace.
73+
74+
## Examples
75+
76+
- [Simple Haystack example (OpenAI)](https://github.com/AgentOps-AI/agentops/blob/main/examples/haystack/haystack_example.py)
77+
- [Haystack Azure OpenAI Chat example](https://github.com/AgentOps-AI/agentops/blob/main/examples/haystack/azure_haystack_example.py)
78+
79+
<script type="module" src="/scripts/github_stars.js"></script>
80+
<script type="module" src="/scripts/scroll-img-fadein-animation.js"></script>
81+
<script type="module" src="/scripts/button_heartbeat_animation.js"></script>
82+
<script type="module" src="/scripts/adjust_api_dynamically.js"></script>
83+

docs/v2/introduction.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Prefer asking your IDE? Install the Mintlify <a href="/v2/usage/mcp-docs"><stron
2727
<Card title="AutoGen" icon={<img src="https://www.github.com/agentops-ai/agentops/blob/main/docs/images/external/autogen/autogen-logo.svg?raw=true" alt="AutoGen" />} iconType="image" href="/v2/integrations/autogen" />
2828
<Card title="CrewAI" icon={<img src="https://www.github.com/agentops-ai/agentops/blob/main/docs/images/external/crewai/crewai-logo.png?raw=true" alt="CrewAI" />} iconType="image" href="/v2/integrations/crewai" />
2929
<Card title="Google ADK" icon={<img src="https://www.github.com/agentops-ai/agentops/blob/main/docs/images/external/google-adk/google-adk-logo.png?raw=true" alt="Google ADK" />} iconType="image" href="/v2/integrations/google_adk" />
30+
<Card title="Haystack" icon={<img src="https://www.github.com/agentops-ai/agentops/blob/main/docs/images/external/haystack/haystack-logo.png?raw=true" alt="Haystack" />} iconType="image" href="/v2/integrations/haystack" />
3031
<Card title="LangChain" icon={<img src="https://www.github.com/agentops-ai/agentops/blob/main/docs/images/external/langchain/langchain-logo.svg?raw=true" alt="LangChain" />} iconType="image" href="/v2/integrations/langchain" />
3132
<Card title="OpenAI Agents (Python)" icon={<img src="https://www.github.com/agentops-ai/agentops/blob/main/docs/images/external/openai/openai-logomark.png?raw=true" alt="OpenAI Agents Python" />} iconType="image" href="/v2/integrations/openai_agents_python" />
3233
<Card title="OpenAI Agents (TypeScript)" icon={<img src="https://www.github.com/agentops-ai/agentops/blob/main/docs/images/external/openai/openai-logomark.png?raw=true" alt="OpenAI Agents JS" />} iconType="image" href="/v2/integrations/openai_agents_js" />

0 commit comments

Comments
 (0)