Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/EllisYuan/ChatAgents/llms.txt

Use this file to discover all available pages before exploring further.

ChatAgents ships with two agent modes that map directly to different Tavily parameter profiles and system prompts. Fast Mode prioritises speed and cost: it uses shallower search depth, fewer results, and skips image retrieval — ideal for everyday factual queries. Deep Thinking Mode trades those savings for thoroughness: it runs advanced searches, crawls more pages, includes images, and uses a research-focused prompt — the right choice when a question demands multi-source analysis or visual content. Picking the wrong mode won’t break anything, but it will either cost you more credits than necessary or return a shallower answer than you need.
Start with Fast Mode and only switch to Deep Thinking if the answer is insufficient. Deep Thinking costs roughly 3–4× more Tavily credits per query and takes 2–5× longer to respond.

Mode Comparison

Parameter⚡ Fast Mode🧠 Deep Thinking Mode
search_depthbasicadvanced
max_results35
include_imagesFalseTrue
crawl_limit5 pages15 pages
extract_depthbasicadvanced
Typical response time1–3 seconds3–8 seconds
Est. Tavily credits per query~15–25 credits~50–80 credits
Best forSimple factual queries, high-frequency use, cost-sensitive workloadsComplex research, multi-source analysis, visual content

Fast Mode

Fast Mode is the default and is optimised for speed and economy. It answers most direct questions without the overhead of deep-crawl or advanced extraction. When to use Fast Mode:
  • Simple factual lookups (“What is the capital of France?”)
  • Real-time event checks where only a headline is needed
  • High-frequency or automated queries where cost adds up quickly
  • Cost-sensitive environments with limited Tavily quota
What it does: When agent_type="fast" is passed to build_graph(), the following parameter profile is applied across all three Tavily tools:
# backend/agent.py — Fast Mode parameters
depth = "basic"          # search_depth and extract_depth
max_results = 3          # TavilySearch: number of results returned
include_images = False   # TavilySearch + TavilyExtract: skip image URLs
crawl_limit = 5          # TavilyCrawl: max pages followed from start URL
The corresponding TavilySearch instantiation in build_graph():
search = TavilySearch(
    max_results=3,
    tavily_api_key=api_key,
    include_favicon=True,
    search_depth="basic",
    include_answer=False,
    topic=topic,
    include_images=False,
    # time_range added dynamically if specified
)
FastAPI selects the simple, conversational system prompt for this mode:
if body.agent_type == "fast":
    prompt = get_simple_prompt()

Deep Thinking Mode

Deep Thinking Mode is built for research tasks. It runs more thorough searches, follows more links, and pulls in visual content — at the cost of higher latency and credit usage. When to use Deep Thinking Mode:
  • Complex multi-step research questions (“Compare LangChain and LangGraph architectures”)
  • Queries requiring data from several different sources or domains
  • Tasks where visual evidence matters (charts, screenshots, diagrams)
  • Quality-first workloads where completeness outweighs cost
What it does: When agent_type="deep" is passed to build_graph(), the parameter profile shifts to advanced depth across all tools:
# backend/agent.py — Deep Thinking Mode parameters
depth = "advanced"       # search_depth and extract_depth
max_results = 5          # TavilySearch: more results for broader coverage
include_images = True    # TavilySearch + TavilyExtract: include image URLs
crawl_limit = 15         # TavilyCrawl: follow up to 15 nested pages
The corresponding TavilySearch instantiation:
search = TavilySearch(
    max_results=5,
    tavily_api_key=api_key,
    include_favicon=True,
    search_depth="advanced",
    include_answer=False,
    topic=topic,
    include_images=True,
    # time_range added dynamically if specified
)
FastAPI selects the more structured research system prompt for this mode, which instructs the agent to use up to 5 tool calls per query and to format its output as a well-cited Markdown report:
elif body.agent_type == "deep":
    prompt = get_reasoning_prompt()

Advanced Parameters

Two additional parameters — topic and time_range — let you fine-tune both modes without switching between them. They are passed to WebAgent.build_graph() and flow through to the TavilySearch instantiation.

topic

Controls which Tavily search index is targeted:
ValueWhen to use
"general"Default. Broad web queries — facts, documentation, tutorials
"news"Use when the query is explicitly about recent news events or articles
"finance"Use when the query is about specific stocks, earnings, or market data
# News query — latest headlines
agent.build_graph(..., topic="news", time_range="day")

# Finance query — weekly market overview
agent.build_graph(..., topic="finance", time_range="week")

time_range

Filters results by recency. Leave as None (the default) for timeless queries:
ValueCovers
"day"Last 24 hours
"week"Last 7 days
"month"Last 30 days
"year"Last 365 days
NoneNo time filter (default)
time_range is only appended to search_params when explicitly set, so the default None leaves the Tavily call unaffected:
# backend/agent.py
if time_range:
    search_params["time_range"] = time_range

Selecting a Mode in the UI

The Streamlit sidebar exposes the mode selector as a radio button with two options:
  • ⚡ Fast Mode — maps to agent_type="fast" in the request body
  • 🧠 Deep Thinking Mode — maps to agent_type="deep" in the request body
The selected mode is included with every message sent to /stream_agent, so you can switch between modes mid-session without losing conversation history. The MemorySaver checkpointer tracks context by thread_id regardless of which mode generated each turn.

Build docs developers (and LLMs) love