You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(ai-agents): incorporate eval review suggestions on quickstarts
- Pydantic: hoist GithubConnector import to Part 3 (prevents NameError)
- All three: add :::note flagging the three system-prompt rules as a stopgap for current SDK behavior
- All three: reword workspace_name troubleshooting bullet to reference connect() kwarg
- All three: fix summary verb (Register/Wire up a single tool)
- Pydantic: note that system_prompt references tool registered in next part
- Pydantic: document that Pydantic AI serializes the dict (no json.dumps needed)
- LangChain/FastMCP: note why json.dumps is used (tools return strings)
- All three: add tool_utils 'appends full catalog + caps responses' detail
- readme: fix 'Airbyte's Airbyte Agents' awkward phrasing
Co-Authored-By: ian.alton@airbyte.io <ian.alton@airbyte.io>
Copy file name to clipboardExpand all lines: docs/ai-agents/get-started/tutorials/quickstarts/readme.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,6 @@ import DocCardList from '@theme/DocCardList';
7
7
8
8
# Airbyte Agents quick starts
9
9
10
-
These tutorials get you started using Airbyte's Airbyte Agents and [agent connectors](../../../connectors). They're intended for people new to Airbyte's Airbyte Agents and its agent connectors. Follow these tutorials to go from having nothing to having an AI agent that works with your data in real time through Airbyte. In most cases, you can achieve this in under half an hour.
10
+
These tutorials get you started with AirbyteAgents and [agent connectors](../../../connectors). They're intended for people new to AirbyteAgents. Follow these tutorials to go from nothing to an AI agent that works with your data in real time through Airbyte. In most cases, you can complete one in under half an hour.
Copy file name to clipboardExpand all lines: docs/ai-agents/get-started/tutorials/quickstarts/tutorial-fastmcp.md
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -170,7 +170,11 @@ The decorator stack is the whole tool definition. No per-action `docstring`, no
170
170
171
171
The rules in the docstring travel to the MCP client as part of the tool description. Models often pattern-match to the underlying REST API they know, so the rules pin them to the catalog's plural entity names, uppercase values, and array-typed filter parameters. `@GithubConnector.tool_utils` appends the full entity and action catalog after the rules, so the final tool description the client sees is your rules plus the catalog.
172
172
173
-
Each `execute` call returns a structured result with `data` (the records) and `meta` (pagination cursors). This tutorial serializes the whole result with `json.dumps` so the MCP client can reason about both the records and the pagination state.
173
+
:::note
174
+
The three numbered rules in the docstring are a stopgap that compensate for current SDK behavior: the auto-generated tool description doesn't enumerate enum values, and some validation errors aren't wrapped as retryable tool errors. Once the SDK surfaces enum values in the tool description and wraps validation errors for retries, you can remove these rules from your own servers.
175
+
:::
176
+
177
+
Each `execute` call returns a structured result with `data` (the records) and `meta` (pagination cursors). MCP tools return strings, so this tutorial serializes the whole result with `json.dumps` so the MCP client can reason about both the records and the pagination state.
174
178
175
179
### Add the server entry point
176
180
@@ -247,7 +251,7 @@ If your agent fails to retrieve GitHub data, check the following:
247
251
248
252
-**Server not found**: Ensure the path in your MCP configuration points to the correct `server.py` file and that `uv` is available on your system PATH.
249
253
-**HTTP 401/403 errors from Airbyte**: Verify that `AIRBYTE_CLIENT_ID` and `AIRBYTE_CLIENT_SECRET` are copied correctly from your [Profile page](https://app.airbyte.ai/profile).
250
-
-**"No connector found" or "connector not configured"**: Make sure you've added a GitHub connector in the [Credentials](https://app.airbyte.ai/credentials) page of the Airbyte Agents web app, and that `workspace_name` matches the workspace where you added it (`"default"`if you haven't changed workspaces).
254
+
-**"No connector found" or "connector not configured"**: Make sure you've added a GitHub connector in the [Credentials](https://app.airbyte.ai/credentials) page of the Airbyte Agents web app. `connect("github")` defaults to the `"default"`workspace; if you added the connector to a different workspace, pass `workspace_name="your-workspace-name"`to `connect()`.
251
255
-**HTTP 401/403 errors from GitHub**: The GitHub token or OAuth credentials stored in your connector are invalid or missing required scopes. Open your GitHub connector in the web app and reauthenticate with a valid token that has `repo` scope.
252
256
-**Empty `data=[]` responses from filtered queries**: Most GitHub filters use case-sensitive values. Confirm the agent is sending uppercase values (for example, `states=["OPEN"]` rather than `states=["open"]`). The tool description's rules nudge the model to do that by default; you can also reinforce the rules in your client's system prompt.
253
257
@@ -258,7 +262,7 @@ In this tutorial, you learned how to:
258
262
- Set up a new Python project with uv
259
263
- Add FastMCP and Airbyte's GitHub agent connector to your project
260
264
- Configure environment variables for your Airbyte Agents credentials
261
-
-Expose the entire GitHub API as a single MCP tool
265
+
-Register a single MCP tool that covers the entire GitHub API
262
266
- Register your MCP server with an agent and use natural language to interact with GitHub data through Airbyte
The decorator stack is the whole tool definition. No per-action `docstring`, no `GITHUB_LIST_COMMITS` or `GITHUB_GET_PR` sprawl, one entry point that covers the full connector. As the connector grows, the tool signature stays the same.
166
+
The decorator stack is the whole tool definition. No per-action `docstring`, no `GITHUB_LIST_COMMITS` or `GITHUB_GET_PR` sprawl, one entry point that covers the full connector. `@GithubConnector.tool_utils` appends the full entity and action catalog to the tool description, and caps oversized responses. As the connector grows, the tool signature stays the same.
167
167
168
-
Each `execute` call returns a structured result with `data` (the records) and `meta` (pagination cursors). This tutorial serializes the whole result with `json.dumps` so the agent can reason about both the records and the pagination state.
168
+
Each `execute` call returns a structured result with `data` (the records) and `meta` (pagination cursors). LangChain tools return strings, so this tutorial serializes the whole result with `json.dumps` so the agent can reason about both the records and the pagination state.
169
169
170
170
### Define the agent
171
171
@@ -197,6 +197,10 @@ agent = create_react_agent(
197
197
- `create_react_agent` creates a ReAct agent that reasons about which tools to call based on the user's input.
198
198
- The `prompt` parameter is where you encode API idiosyncrasies the model can't see in the tool schema. Models often pattern-match to the underlying REST API they know, so the prompt pins them to the catalog's plural entity names, uppercase values, and array-typed filter parameters. Add similar constraints for your own domain (pagination defaults, date formats, preferred streams) as your agent grows.
199
199
200
+
:::note
201
+
The three numbered rules in the prompt are a stopgap that compensate for current SDK behavior: the auto-generated tool description doesn't enumerate enum values, and some validation errors aren't wrapped as retryable tool errors. Once the SDK surfaces enum values in the tool description and wraps validation errors for retries, you can remove these rules from your own agents.
202
+
:::
203
+
200
204
## Part 6: Run your project
201
205
202
206
Now that your agent is configured with tools, update `main.py` and run your project.
@@ -248,7 +252,7 @@ The agent has basic message history within each session, and you can ask followu
248
252
If your agent fails to retrieve GitHub data, check the following:
249
253
250
254
- **HTTP 401/403 errors from Airbyte**: Verify that `AIRBYTE_CLIENT_ID` and `AIRBYTE_CLIENT_SECRET` are copied correctly from your [Profile page](https://app.airbyte.ai/profile).
251
-
- **"No connector found" or "connector not configured"**: Make sure you've added a GitHub connector in the [Credentials](https://app.airbyte.ai/credentials) page of the Airbyte Agents web app, and that `workspace_name` matches the workspace where you added it (`"default"`if you haven't changed workspaces).
255
+
- **"No connector found" or "connector not configured"**: Make sure you've added a GitHub connector in the [Credentials](https://app.airbyte.ai/credentials) page of the Airbyte Agents web app. `connect("github")` defaults to the `"default"`workspace;if you added the connector to a different workspace, pass `workspace_name="your-workspace-name"`to `connect()`.
252
256
- **HTTP 401/403 errors from GitHub**: The GitHub token or OAuth credentials stored in your connector are invalid or missing required scopes. Open your GitHub connector in the web app and reauthenticate with a valid token that has `repo` scope.
253
257
- **Empty `data=[]` responses from filtered queries**: Most GitHub filters use case-sensitive values. Confirm the agent is sending uppercase values (for example, `states=["OPEN"]` rather than `states=["open"]`). The system prompt in this tutorial nudges the model to do that by default.
254
258
- **OpenAI errors**: Verify your `OPENAI_API_KEY` is valid, has available credits, and won't exceed rate limits.
@@ -260,7 +264,7 @@ In this tutorial, you learned how to:
260
264
- Set up a new Python project with uv
261
265
- Add LangChain, LangGraph, and Airbyte's GitHub agent connector to your project
262
266
- Configure environment variables for your Airbyte Agents credentials
263
-
- Connect a single tool that covers the entire GitHub API
267
+
- Wire up a single tool that covers the entire GitHub API
264
268
- Build a ReAct agent with LangGraph and use natural language to interact with GitHub data through Airbyte
Copy file name to clipboardExpand all lines: docs/ai-agents/get-started/tutorials/quickstarts/tutorial-pydantic.md
+11-10Lines changed: 11 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -88,13 +88,15 @@ If you want a smaller installation with only OpenAI support, you can use `pydant
88
88
from dotenv import load_dotenv
89
89
from pydantic_ai import Agent
90
90
from airbyte_agent_sdk import connect
91
+
from airbyte_agent_sdk.connectors.github import GithubConnector
91
92
```
92
93
93
94
These imports provide:
94
95
95
96
- `load_dotenv`: Load environment variables from your `.env` file.
96
97
- `Agent`: The Pydantic AI agent class that orchestrates LLM interactions and tool calls.
97
98
- `connect`: The Airbyte agent SDK entry point. One call returns a typed connector bound to your workspace.
99
+
- `GithubConnector`: The connector class. You reference it when decorating the tool so the SDK can describe the connector's entities and actions to the agent.
98
100
99
101
## Part 4: Add a .env file with your secrets
100
102
@@ -168,6 +170,11 @@ agent = Agent(
168
170
169
171
- The `"openai:gpt-4o"` string specifies the model to use. You can use a different model by changing the model string. For example, use `"openai:gpt-4o-mini"` to lower costs, or see the [Pydantic AI models documentation](https://ai.pydantic.dev/models/) for other providers like Anthropic or Google.
170
172
- The `system_prompt` parameter is where you encode API idiosyncrasies the model can't see in the tool schema. Models often pattern-match to the underlying REST API they know, so the prompt pins them to the catalog's plural entity names, uppercase values, and array-typed filter parameters. Add similar constraints for your own domain (pagination defaults, date formats, preferred streams) as your agent grows.
173
+
- The prompt references a `github_execute` tool. You register that tool in the next part.
174
+
175
+
:::note
176
+
The three numbered rules in the prompt are a stopgap that compensate forcurrent SDK behavior: the auto-generated tool description doesn't enumerate enum values, and some validation errors aren't wrapped as retryable tool errors. Once the SDK surfaces enum valuesin the tool description and wraps validation errors for retries, you can remove these rules from your own agents.
return await github.execute(entity, action, params or {})
183
190
```
184
191
185
-
The decorator stack is the whole tool definition. No per-action `docstring`, no `GITHUB_LIST_COMMITS` or `GITHUB_GET_PR` sprawl, one entry point that covers the full connector. As the connector grows, the tool signature stays the same.
186
-
187
-
Add the `GithubConnector` import at the top of `agent.py` so the decorator resolves:
188
-
189
-
```python title="agent.py"
190
-
from airbyte_agent_sdk.connectors.github import GithubConnector
191
-
```
192
+
The decorator stack is the whole tool definition. No per-action `docstring`, no `GITHUB_LIST_COMMITS` or `GITHUB_GET_PR` sprawl, one entry point that covers the full connector. `@GithubConnector.tool_utils` appends the full entity and action catalog to the tool description, and caps oversized responses. As the connector grows, the tool signature stays the same.
192
193
193
-
Each `execute` call returns a structured result with `data` (the records) and `meta` (pagination cursors). You can keep the result as-is for the model, filter it in Python, or page through it using `meta.end_cursor`.
194
+
Each `execute` call returns a structured result with `data` (the records) and `meta` (pagination cursors). Pydantic AI serializes the dict for the model automatically, so you don't need to call `json.dumps` here. You can keep the result as-is, filter it in Python, or page through it using `meta.end_cursor`.
194
195
195
196
## Part 7: Run your project
196
197
@@ -241,7 +242,7 @@ The agent has basic message history within each session, and you can ask followu
241
242
If your agent fails to retrieve GitHub data, check the following:
242
243
243
244
- **HTTP 401/403 errors from Airbyte**: Verify that `AIRBYTE_CLIENT_ID` and `AIRBYTE_CLIENT_SECRET` are copied correctly from your [Profile page](https://app.airbyte.ai/profile).
244
-
- **"No connector found" or "connector not configured"**: Make sure you've added a GitHub connector in the [Credentials](https://app.airbyte.ai/credentials) page of the Airbyte Agents web app, and that `workspace_name` matches the workspace where you added it (`"default"`if you haven't changed workspaces).
245
+
- **"No connector found" or "connector not configured"**: Make sure you've added a GitHub connector in the [Credentials](https://app.airbyte.ai/credentials) page of the Airbyte Agents web app. `connect("github")` defaults to the `"default"` workspace; if you added the connector to a different workspace, pass `workspace_name="your-workspace-name"` to `connect()`.
245
246
- **HTTP 401/403 errors from GitHub**: The GitHub token or OAuth credentials stored in your connector are invalid or missing required scopes. Open your GitHub connector in the web app and reauthenticate with a valid token that has `repo` scope.
246
247
- **Empty `data=[]` responses from filtered queries**: Most GitHub filters use case-sensitive values. Confirm the agent is sending uppercase values (for example, `states=["OPEN"]` rather than `states=["open"]`). The system prompt in this tutorial nudges the model to do that by default.
247
248
- **OpenAI errors**: Verify your `OPENAI_API_KEY` is valid, has available credits, and won't exceed rate limits.
@@ -253,7 +254,7 @@ In this tutorial, you learned how to:
253
254
- Set up a new Python project with uv
254
255
- Add Pydantic AI and Airbyte's GitHub agent connector to your project
255
256
- Configure environment variables for your Airbyte Agents credentials
256
-
- Connect a single tool that covers the entire GitHub API
257
+
- Register a single tool that covers the entire GitHub API
257
258
- Run your project and use natural language to interact with GitHub data through Airbyte
0 commit comments