tavily-dynamic-search

โดย tavily-ai

ค้นหาเว็บ กรองผลลัพธ์ และดึงเนื้อหา เพื่อให้ข้อมูลการค้นหาดิบไม่เข้าสู่หน้าต่างบริบทของคุณ มีเพียงผลลัพธ์ print() ที่คุณจัดเตรียมไว้เท่านั้นที่จะถูกส่งกลับมา

npx skills add https://github.com/tavily-ai/skills --skill tavily-dynamic-search

Tavily Dynamic Search

Keep large raw web payloads on disk and return only the evidence needed for the task. This is useful when using --include-raw-content, combining several queries, or extracting multiple long pages. Do not use this workflow for a simple lookup that a normal tvly search --json can answer directly.

Before running

Search and extract support capped keyless access. Run them directly when tvly is available. If tvly is missing, follow the tavily-cli setup. Do not look for an API key or authenticate before the first request. If the keyless cap is reached in an interactive session, run tvly login to open browser OAuth, then retry the blocked request once. In an unattended environment, report the cap and authentication options instead of starting an interactive flow.

Workflow

  1. Search broadly without raw content and inspect titles, URLs, scores, and snippets.
  2. Fetch full content only for the best sources.
  3. When raw output could be large, save it with -o and filter the file before printing anything to the model context.
  4. Preserve source URLs beside every extracted fact.

When the user restricts evidence to official or named domains, validate the hostname of every selected URL during local filtering. --include-domains narrows the search but is not proof that every returned result belongs to an allowed host. If full-page extraction is unavailable, label conclusions as search-snippet evidence instead of implying that the page body was verified.

Keep the process in one turn when the relevant sources and filters are already known. Use another turn only when the first search changes what should be extracted.

Create a unique temporary task directory before saving evidence so concurrent agents do not overwrite one another. Python's tempfile.mkdtemp() is available when mktemp is not permitted. Reuse that directory for all raw and filtered artifacts from the task.

Small result: filter a direct JSON response

For a small search response, a pipe is enough:

tvly search "query" --max-results 5 --json | python3 -c '
import json, sys
data = json.load(sys.stdin)
for result in data.get("results", []):
    score = result.get("score") or 0
    title = result.get("title") or ""
    print(f"[{score:.2f}] {title}")
    print(result.get("url", ""))
    print(result.get("content", "")[:300])
'

Do not discard stderr. Authentication failures, keyless-cap messages, and API errors are actionable and must remain visible.

Large result: save first, then filter

Use the CLI's file output so raw page content does not pass through the tool response:

tvly search "query" \
  --include-raw-content markdown \
  --max-results 8 \
  --json \
  -o /tmp/tavily-search-results.json

Then print only bounded evidence:

python3 -c '
import json
from pathlib import Path

data = json.loads(Path("/tmp/tavily-search-results.json").read_text())
for result in data.get("results", []):
    title = result.get("title") or ""
    url = result.get("url") or ""
    print(f"## {title}")
    print(f"URL: {url}")
    print((result.get("raw_content") or result.get("content") or "")[:1200])
    print()
'

Adjust the filtering logic to the question. Prefer relevant paragraphs or fields over fixed character slices when the target information is known. Aim for roughly 150-600 tokens per source unless a table or code block genuinely requires more.

Targeted extraction

When search identifies the right URLs, extract only those pages:

tvly extract "https://example.com/article" \
  --json \
  -o /tmp/tavily-extract-results.json

For topic-focused pages, let Tavily reduce the response before local filtering:

tvly extract "https://example.com/docs" \
  --query "authentication API" \
  --chunks-per-source 3 \
  --json \
  -o /tmp/tavily-extract-results.json

Multiple queries

For multi-angle research, run a small set of focused searches, deduplicate by URL, and rank before extracting. Use subprocess.run(..., capture_output=True, text=True) when orchestrating commands in Python. Check returncode; if a command fails, surface its stderr and stop or retry deliberately. Never use a blanket except Exception: continue that hides missing evidence.

Response shapes

tvly search --json returns query, optional answer, results, and response_time. Each result commonly contains url, title, content, score, and optional raw_content.

tvly extract --json returns results, failed_results, and response_time. Each successful result commonly contains url, raw_content, and optional images.

Treat fields as optional and use .get() while filtering. Inspect failed_results instead of assuming every requested URL succeeded.

Useful options

OptionPurpose
--max-resultsBound the search result count; default 5, maximum 20
--depthChoose ultra-fast, fast, basic, or advanced
--time-rangeRestrict results to day, week, month, or year
--include-domainsRestrict results to a comma-separated list of trusted domains
--exclude-domainsExclude a comma-separated list of domains
--include-raw-contentInclude full content as markdown or text
-o, --outputSave the complete response to a file

Use jq only for short filters when Python is unavailable:

tvly search "query" --json | jq '[.results[] | {title, url, score, content}]'

Skills เพิ่มเติมจาก tavily-ai

research
tavily-ai
การวิจัยเชิงลึกในทุกหัวข้อ พร้อมการรวบรวมแหล่งข้อมูล วิเคราะห์ และอ้างอิงโดยอัตโนมัติ ดำเนินการวิจัยทางเว็บจากหลายแหล่งพร้อมการอ้างอิงที่ชัดเจน เหมาะสำหรับการเปรียบเทียบ เหตุการณ์ปัจจุบัน การวิเคราะห์ตลาด และรายงานโดยละเอียด มีสามตัวเลือกโมเดล: mini สำหรับการวิจัยหัวข้อเดียวแบบเจาะจง (~30 วินาที), pro สำหรับการวิเคราะห์หลายมุมแบบครอบคลุม (~60-120 วินาที) และ auto สำหรับการตรวจจับความซับซ้อนผ่าน API ยืนยันตัวตนผ่าน OAuth ผ่านเซิร์ฟเวอร์ Tavily MCP พร้อมการเข้าสู่ระบบผ่านเบราว์เซอร์อัตโนมัติบน...
search
tavily-ai
ค้นหาเว็บด้วยผลลัพธ์ที่ปรับให้เหมาะสมกับ LLM การให้คะแนนความเกี่ยวข้อง และการกรองที่ยืดหยุ่น รองรับโหมดความลึกในการค้นหาสี่โหมด (เร็วพิเศษ เร็ว พื้นฐาน ขั้นสูง) พร้อมการปรับแต่งความหน่วงและความเกี่ยวข้องที่กำหนดค่าได้ รวมถึงการกรองโดเมน ข้อจำกัดช่วงเวลา ช่วงวันที่ การเพิ่มน้ำหนักประเทศ และการดึงเนื้อหาดิบ ส่งคืนผลลัพธ์พร้อมชื่อเรื่อง URL ตัวอย่างเนื้อหา และคะแนนความเกี่ยวข้อง ผลลัพธ์รูปภาพและ favicon แบบเลือกได้ การรับรองความถูกต้อง OAuth อัตโนมัติผ่านเซิร์ฟเวอร์ Tavily MCP หรือการกำหนดค่าคีย์ API...
tavily-best-practices
tavily-ai
Web search API สำหรับ LLMs ที่เข้าถึงข้อมูลแบบเรียลไทม์ ดึงเนื้อหา ค้นหาเว็บไซต์ และวิจัยด้วย AI มีห้าวิธีหลัก: search() สำหรับผลลัพธ์เว็บ, extract() สำหรับเนื้อหา URL, crawl() สำหรับดึงข้อมูลทั้งเว็บไซต์, map() สำหรับค้นหา URL, และ research() สำหรับสังเคราะห์ AI แบบครบวงจร รองรับ Python และ JavaScript SDK พร้อม async clients สำหรับการค้นหาแบบขนานและปรับความลึกการค้นหาได้ (ultra-fast/fast/basic/advanced) วิธี crawl รองรับคำสั่งเชิงความหมายเพื่อโฟกัสการดึงข้อมูลที่...
tavily-cli
tavily-ai
การค้นหาเว็บ การดึงเนื้อหา การรวบรวมข้อมูลเว็บไซต์ และการวิจัยเชิงลึกผ่าน Tavily CLI มีโหมดคำสั่งห้าโหมดครอบคลุมการค้นหา การดึงข้อมูล การค้นพบ URL การรวบรวมข้อมูลจำนวนมาก และการวิจัยหลายแหล่งพร้อมการอ้างอิง คำสั่งทั้งหมดรองรับเอาต์พุต JSON และการบันทึกไฟล์สำหรับเวิร์กโฟลว์แบบมีโครงสร้างและแบบเอเจนต์ รูปแบบการเพิ่มระดับจะแนะนำคุณจากการค้นหาอย่างง่ายผ่านการดึงข้อมูล การทำแผนที่ การรวบรวมข้อมูล ไปจนถึงการวิจัยที่ครอบคลุมตามความต้องการของคุณ ต้องติดตั้ง tavily-cli และการตรวจสอบสิทธิ์คีย์ API ผ่าน tvly login
tavily-crawl
tavily-ai
โปรแกรมรวบรวมข้อมูลเว็บไซต์หลายหน้าที่มีการกรองเชิงความหมายและส่งออกเป็นมาร์กดาวน์ เรียกดูส่วนต่างๆ ของไซต์ทั้งหมดพร้อมควบคุมความลึกและความกว้าง กรองตาม regex ของเส้นทาง โดเมน หรือคำสั่งภาษาธรรมชาติเพื่อเน้นผลลัพธ์ บันทึกแต่ละหน้าเป็นไฟล์มาร์กดาวน์ในเครื่องผ่าน --output-dir หรือส่งคืน JSON ที่มีโครงสร้างสำหรับการประมวลผลแบบเอเจนต์ ใช้คำสั่งเชิงความหมายพร้อมการแยกส่วนเพื่อป้องกันการขยายบริบทเมื่อป้อนผลลัพธ์ให้กับ LLM ใช้การแยกทั้งหน้าสำหรับการดาวน์โหลดเอกสารออฟไลน์ รองรับ...
tavily-extract
tavily-ai
แยกข้อมูลเป็น markdown หรือข้อความที่สะอาดจาก URL สูงสุด 20 รายการ พร้อมรองรับการเรนเดอร์ JavaScript และการแบ่งส่วนตามคำค้นหา จัดการหน้าเว็บที่เรนเดอร์ด้วย JavaScript ได้ โดยปรับระดับการแยกข้อมูลได้ (พื้นฐานสำหรับหน้าเว็บธรรมดา ขั้นสูงสำหรับ SPA และตารางแบบไดนามิก) รองรับการแยกข้อมูลตามคำค้นหาเพื่อส่งคืนเฉพาะเนื้อหาที่เกี่ยวข้อง แทนที่จะส่งคืนทั้งหน้า ส่งคืน markdown ที่ปรับให้เหมาะสมกับ LLM โดยค่าเริ่มต้น พร้อมตัวเลือกรูปแบบข้อความธรรมดาและเอาต์พุต JSON แบบมีโครงสร้าง ประมวลผล URL สูงสุด 20 รายการในการเรียกครั้งเดียว...
tavily-research
tavily-ai
การวิจัยที่ขับเคลื่อนด้วย AI อย่างครอบคลุม พร้อมการสังเคราะห์จากหลายแหล่งและการอ้างอิง สร้างรายงานที่มีโครงสร้างซึ่งอ้างอิงจากแหล่งข้อมูลบนเว็บ ใช้เวลา 30-120 วินาที ขึ้นอยู่กับการเลือกโมเดล (mini สำหรับคำค้นหาเฉพาะเจาะจง pro สำหรับการเปรียบเทียบที่ซับซ้อน) รองรับรูปแบบผลลัพธ์หลายแบบ: รายงาน markdown, JSON พร้อม schema ที่กำหนดเอง และรูปแบบการอ้างอิงที่ปรับแต่งได้ (หมายเลข, MLA, APA, Chicago) รวมถึงเวิร์กโฟลว์แบบอะซิงโครนัสสำหรับการวิจัยที่ใช้เวลานานผ่านคำสั่ง --no-wait, status และ poll พร้อมการทำงานแบบเรียลไทม์...
tavily-search
tavily-ai
ค้นหาเว็บด้วยผลลัพธ์ที่ปรับให้เหมาะสมกับ LLM ตัวอย่างเนื้อหา และคะแนนความเกี่ยวข้อง รองรับความลึกในการค้นหาสี่ระดับ (เร็วพิเศษ เร็ว พื้นฐาน ขั้นสูง) พร้อมกำหนดจำนวนผลลัพธ์ได้สูงสุดถึง 20 รายการ รวมถึงการกรองโดเมนและข้อจำกัดช่วงเวลา ส่งคืนผลลัพธ์ในรูปแบบ JSON ที่มีโครงสร้างพร้อมตัวอย่างเนื้อหา คะแนนความเกี่ยวข้อง และข้อมูลเมตาที่ปรับให้เหมาะสมสำหรับการใช้งาน LLM รวมถึงโหมดการค้นหาเฉพาะสำหรับหัวข้อข่าวและการเงิน พร้อมคำตอบที่สร้างโดย AI แบบไม่บังคับ และการดึงเนื้อหาหน้าเต็ม รวมเข้ากับ...