๐ Query rewritten: "What are the current trends in Artificial Intelligence?"โญโ Agent Info โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎโ ๐ค Agent: DirectAgent โโ Role: Assistant โโฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏโญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ Response โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎโ Current AI trends include... โโฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
# Built-in SDK toolpraisonai "latest developments" --query-rewrite --rewrite-tools "internet_search"# praisonai-tools / entry-point plugin โ now resolved via the full tool chainpraisonai "latest developments" --query-rewrite --rewrite-tools "duckduckgo_search"# Custom local tool (requires the env-var gate)PRAISONAI_ALLOW_LOCAL_TOOLS=1 praisonai "latest developments" --query-rewrite --rewrite-tools "my_search"
--rewrite-tools now accepts any name reachable by praisonai tools list โ the same resolver chain used by praisonai research --tools and --expand-tools. See Tool Resolution for the full chain.
Rewritten to: โWhat are the key differences between OpenAIโs GPT-4 and Anthropicโs Claude 3 language models in terms of capabilities, performance, and use cases?โ
Rewritten to: โHow do I set up a Retrieval-Augmented Generation (RAG) system, including document ingestion, embedding generation, vector storage, and query processing?โ
The CLIโs --query-rewrite step honours the standard cascade โ CLI flag wins, env vars next, gpt-4o-mini fallback last:
# Rewriter uses claude-3-5-sonnet-latest, matching the main agentpraisonai "What about cost?" --query-rewrite --llm claude-3-5-sonnet-latest
To keep a cheap rewriter regardless of the main model, pin it explicitly with OPENAI_MODEL_NAME=gpt-4o-mini while --llm drives the main agent โ but the recommended pattern is running the rewriter and main agent on the same model.
The model= kwarg on QueryRewriterAgent is unchanged โ the cascade above applies only to the CLI path.
from praisonaiagents import QueryRewriterAgent, RewriteStrategyagent = QueryRewriterAgent(model="gpt-4o-mini")# Basic rewriteresult = agent.rewrite("AI trends")print(result.primary_query) # "What are the current trends in Artificial Intelligence?"# With specific strategyresult = agent.rewrite("What is quantum computing?", strategy=RewriteStrategy.HYDE)# Step-back for broader contextresult = agent.rewrite("GPT-4 vs Claude 3?", strategy=RewriteStrategy.STEP_BACK)# Sub-queries for complex questionsresult = agent.rewrite("RAG setup and best embedding models?", strategy=RewriteStrategy.SUB_QUERIES)# Contextual with chat historyresult = agent.rewrite("What about cost?", chat_history=[...])