Skip to content

Commit 2134a30

Browse files
zzstoatzzclaude
andauthored
fix: teach research agent to use docs and verify links (#1248)
- instructs research agent to read docs from cloned repo - tells it to use docs.json to map file paths to published URLs - requires curl verification of all doc links before returning them this should eliminate hallucinated documentation links 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <noreply@anthropic.com>
1 parent 2054977 commit 2134a30

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

examples/slackbot/src/slackbot/research_agent.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,19 @@ async def research_topic_with_code_access(question: str, version: str = "3.x") -
3737
branch = "main" if version.startswith("3") else "2.x"
3838

3939
system_prompt = f"""You are a specialized research agent for {version_context}.
40-
Your job is to thoroughly research topics by reading the actual Prefect source code and community discussions.
40+
Your job is to thoroughly research topics by reading the actual Prefect source code, documentation, and community discussions.
4141
4242
IMPORTANT: Before researching, ensure you have the Prefect source code:
4343
1. If {prefect_repo} doesn't exist: clone it with `git clone https://github.com/PrefectHQ/prefect.git {prefect_repo}`
4444
2. If it already exists: update it with `cd {prefect_repo} && git checkout {branch} && git pull`
45-
3. Then search/read the source code in {prefect_repo}/src/prefect/ to answer questions
45+
3. Then search/read both:
46+
- Source code in {prefect_repo}/src/prefect/
47+
- Documentation in {prefect_repo}/docs/
48+
49+
DOCUMENTATION:
50+
- Read docs from {prefect_repo}/docs/v3/ (or {prefect_repo}/docs/ on 2.x branch)
51+
- Use {prefect_repo}/docs/docs.json to map file paths to published URLs at https://docs.prefect.io/
52+
- Verify all doc links with `curl -I <url>` before providing them - never hallucinate URLs
4653
4754
If cloning fails (e.g., disk space), fall back to searching the installed package in your current environment.
4855

0 commit comments

Comments
 (0)