Skip to content

docs(ai-agents): add chat.agent guide and refresh the AI agent guides - #4524

Open
D-K-P wants to merge 3 commits into
mainfrom
docs-ai-agents-chat-agent-guide
Open

docs(ai-agents): add chat.agent guide and refresh the AI agent guides#4524
D-K-P wants to merge 3 commits into
mainfrom
docs-ai-agents-chat-agent-guide

Conversation

@D-K-P

@D-K-P D-K-P commented Aug 6, 2026

Copy link
Copy Markdown
Member

Summary

Adds a "Build a chat agent" guide to the AI agents section, surfaces the
ClickHouse chat agent example in the guides index and the AI agents overview,
and refreshes the five existing workflow guides so their code is current.

Details

The pattern guides (prompt chaining, routing, parallelization, orchestrator,
evaluator-optimizer) still used retired models and dated APIs. Updated them to
current Anthropic Claude models (claude-haiku-4-5 for lightweight classifier
roles, claude-sonnet-4-5 for the main work) and modernized the code:

  • route-question uses generateObject for the routing decision instead of
    generateText plus manual JSON parsing.
  • verify-news-article uses ModelMessage in place of the renamed CoreMessage.
  • Fixed translate-and-refine discarding its recursive refinement result, so
    refined translations never returned to the caller.
  • Fixed an invalid JSON test payload in generate-translate-copy.

The pattern concepts are unchanged; only the example code was stale.

Adds a "Build a customer support chat agent" guide to the AI agents
section, surfaces the ClickHouse chat agent example in the guides index
and the AI agents overview, and refreshes the five existing workflow
guides so their code is current.

The pattern guides (prompt chaining, routing, parallelization,
orchestrator, evaluator-optimizer) still used retired models and dated
APIs. Updated them to current Anthropic Claude models (claude-haiku-4-5
for lightweight classifier roles, claude-sonnet-4-5 for the main work)
and modernized the code:

- route-question uses generateObject for the routing decision instead of
  generateText plus manual JSON parsing.
- verify-news-article uses ModelMessage in place of the renamed CoreMessage.
- Fixed translate-and-refine discarding its recursive refinement result,
  so refined translations never returned to the caller.
- Fixed an invalid JSON test payload in generate-translate-copy.

The pattern concepts are unchanged; only the example code was stale.
@changeset-bot

changeset-bot Bot commented Aug 6, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: d0a3827

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@D-K-P
D-K-P enabled auto-merge (squash) August 6, 2026 18:51

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 52b68ce7-cf63-45d8-a565-5222f99a310f

📥 Commits

Reviewing files that changed from the base of the PR and between 488683b and d0a3827.

📒 Files selected for processing (2)
  • docs/guides/ai-agents/chat-agent.mdx
  • docs/guides/ai-agents/translate-and-refine.mdx
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/guides/ai-agents/chat-agent.mdx
📜 Recent review details
🧰 Additional context used
📓 Path-based instructions (1)
docs/**/*.mdx

📄 CodeRabbit inference engine (docs/CLAUDE.md)

docs/**/*.mdx: MDX documentation pages must include frontmatter with title (required), description (required), and sidebarTitle (optional) in YAML format
Use Mintlify components for structured content: , , , , , , /, /
Always import from @trigger.dev/sdk in code examples (never from @trigger.dev/sdk/v3)
Code examples must be complete and runnable where possible
Use language tags in code fences: typescript, bash, json

Documentation in docs/ uses MDX conventions defined by the documentation guidance.

Files:

  • docs/guides/ai-agents/translate-and-refine.mdx
🧠 Learnings (2)
📚 Learning: 2026-03-10T12:44:14.176Z
Learnt from: nicktrn
Repo: triggerdotdev/trigger.dev PR: 3200
File: docs/config/config-file.mdx:353-368
Timestamp: 2026-03-10T12:44:14.176Z
Learning: In the trigger.dev repo, docs PRs are often companions to implementation PRs. When reviewing docs PRs (MDX files under docs/), check the PR description for any companion/related PR references and verify that the documented features exist in those companion PRs before flagging missing implementations. This ensures docs stay in sync with code changes across related PRs.

Applied to files:

  • docs/guides/ai-agents/translate-and-refine.mdx
📚 Learning: 2026-04-30T20:30:29.458Z
Learnt from: ericallam
Repo: triggerdotdev/trigger.dev PR: 3226
File: docs/ai-chat/quick-start.mdx:13-13
Timestamp: 2026-04-30T20:30:29.458Z
Learning: In this repo’s documentation MDX files (`docs/**/*.mdx`), use `ts` and `tsx` (not `typescript`) as the code-fence language tags for TypeScript/TSX snippets. Do not flag `ts`/`tsx` code-fence language tags as incorrect in any docs MDX file, since this is the site-wide Mintlify-compatible convention.

Applied to files:

  • docs/guides/ai-agents/translate-and-refine.mdx
🔇 Additional comments (5)
docs/guides/ai-agents/translate-and-refine.mdx (5)

28-28: LGTM!


38-48: LGTM!


66-66: LGTM!


86-94: LGTM!


145-147: LGTM!


Walkthrough

Added documentation for durable, multi-turn chat agents with streaming, tools, session startup, and access tokens. Added chat agent entries to documentation navigation and project lists. Updated AI agent examples to use Anthropic models. Replaced manual routing parsing with typed classification and fixed recursive refinement result propagation. Corrected an example payload to valid JSON.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains the main changes but omits the required issue reference, checklist, testing steps, changelog, and screenshots sections. Add the template sections, include the linked issue, complete the checklist, document testing steps, provide a changelog entry, and add screenshots or state that they are not applicable.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main changes: adding the chat.agent guide and updating the AI agent guides.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs-ai-agents-chat-agent-guide

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

coderabbitai[bot]

This comment was marked as resolved.

Describe the chat agent lifecycle as a durable session rather than a single
run, add an authorization note to the token-minting example, switch the guide
code fences to the typescript language tag, and enable telemetry on the news
verifier's claim-extraction call so it matches the guide's description.
devin-ai-integration[bot]

This comment was marked as resolved.

Pass tools into chat.toStreamTextOptions({ tools }) in the chat agent guide so
HITL approval detection and auto-injected skill tools survive, instead of
passing them straight to streamText where the merged set is dropped. Give the
recursive translate-and-refine task an explicit return type so the copied
snippet doesn't hit TypeScript's circular-inference error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant