The Three WeKnora Reasoning Modes: Quick‑Answer, Agent, and Smart‑Reasoning Explained

WeKnora provides three reasoning modes—Quick‑Answer (RAG), Agent (ReAct), and Smart‑Reasoning—that control how queries are processed, ranging from single‑turn retrieval to multi‑step autonomous tool execution.

Tencent's WeKnora supports three distinct reasoning modes that determine how user queries are processed and how the system orchestrates retrieval, tool‑calling, and LLM inference. Each mode offers different trade‑offs between execution speed, flexibility, and ease of configuration, allowing developers to optimize for latency, autonomy, or convenience.

Quick‑Answer (RAG) Mode: Single‑Turn Retrieval

Quick‑Answer Mode executes a single‑turn retrieval‑augmented generation (RAG) pipeline designed for minimal latency. The system retrieves relevant chunks from configured knowledge bases and feeds them directly to an LLM for a concise answer without invoking external tools or multi‑step reasoning chains.

According to the project documentation in README.md (lines 25‑27), this mode prioritizes speed over complexity by eliminating tool‑calling overhead. It is ideal for straightforward factual queries where existing documentation contains the answer.


# Conceptual invocation of Quick‑Answer mode

response = weknora.query(
    mode="quick_answer",
    knowledge_base="docs_db",
    query="What is the default timeout?"
)

Agent (ReAct) Mode: Autonomous Tool Execution

Agent Mode implements a multi‑step ReAct (Reasoning and Acting) loop where an autonomous agent iteratively calls tools until reaching a final answer. This mode supports knowledge search, web search, and MCP (Model Context Protocol) services, allowing the system to gather real‑time information or perform calculations beyond static knowledge bases.

In weknora_mcp_server.py (lines 20‑30), this functionality is exposed via the agent_chat interface. The agent evaluates intermediate results, decides which tools to invoke next, and maintains context across multiple reasoning steps.


# Agent mode enables multi‑step reasoning with tool access

response = weknora.agent_chat(
    query="Compare our Q3 revenue with market trends",
    available_tools=["knowledge_search", "web_search", "calculator"],
    max_iterations=5
)

Smart‑Reasoning Mode: Pre‑Configured Hybrid Approach

Smart‑Reasoning Mode provides a streamlined hybrid that pre‑fills system prompts, automatically selects appropriate tools, and applies default knowledge‑base settings. This mode functions as a simplified Agent mode that retains tool‑calling capabilities while hiding advanced configuration controls such as explicit knowledge‑base selection.

The implementation in custom_agent.go (lines 102‑153) handles the orchestration logic, pre‑populating context and restricting low‑level parameters unless explicitly overridden. This reduces boilerplate for common use cases while preserving the ability to execute complex workflows.

// Smart‑Reasoning abstracts agent configuration in custom_agent.go
smartAgent := weknora.NewSmartReasoningAgent(
    DefaultKB: "enterprise_docs",
    AutoSelectTools: true,
)
result := smartAgent.Execute(query)

Summary

  • Quick‑Answer (RAG) Mode delivers the fastest responses through single‑turn retrieval without tool overhead, ideal for static knowledge queries.
  • Agent (ReAct) Mode provides maximum flexibility via autonomous multi‑step reasoning with full tool access, suitable for complex research tasks.
  • Smart‑Reasoning Mode balances convenience and capability by automating prompt engineering and tool selection while maintaining agent‑level functionality.

Frequently Asked Questions

What is the difference between Agent Mode and Smart‑Reasoning Mode in WeKnora?

Agent Mode exposes full control over the ReAct loop, requiring manual configuration of tools, knowledge bases, and iteration limits. Smart‑Reasoning Mode automates these decisions by pre‑filling system prompts and selecting default tools, making it easier to deploy while still supporting multi‑step reasoning. Both modes utilize the underlying agent architecture defined in custom_agent.go, but Smart‑Reasoning abstracts the complexity.

When should I use Quick‑Answer Mode instead of Agent Mode?

Use Quick‑Answer Mode when your query can be answered by existing documents in a knowledge base and does not require real‑time data or calculations. According to the source in README.md, this mode avoids the latency of tool‑calling chains. Switch to Agent Mode when queries require web searches, API calls, or multi‑source synthesis that static retrieval cannot satisfy.

How does WeKnora handle tool selection in Smart‑Reasoning Mode?

The Smart‑Reasoning implementation in custom_agent.go (lines 102‑153) automatically maps user intent to available tools based on pre‑configured heuristics and system prompt templates. While Agent Mode requires explicit tool lists in calls to agent_chat (as seen in weknora_mcp_server.py), Smart‑Reasoning infers appropriate tools unless the developer explicitly overrides the defaults.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →