Documentation Index
Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
Use this file to discover all available pages before exploring further.
Web search agent using DuckDuckGo for real-time information gathering.
Simple
Agents: 1 — Single agent with search tool handles query and summarization.
Workflow
- Receive search query
- Execute web search via DuckDuckGo
- Filter and summarize results
- Return formatted response
Setup
pip install praisonaiagents praisonai duckduckgo-search
export OPENAI_API_KEY="your-key"
Run — Python
from praisonaiagents import Agent
from praisonaiagents import duckduckgo
agent = Agent(
name="WebSearcher",
instructions="You are a web search agent. Search and summarize findings.",
tools=[duckduckgo]
)
result = agent.start("What are the latest AI developments in 2024?")
print(result)
Run — CLI
praisonai "What are the latest AI developments?" --web-search
Run — agents.yaml
framework: praisonai
topic: Web Research
roles:
web_searcher:
role: Web Search Specialist
goal: Find and summarize web information
backstory: You are an expert at finding information online
tools:
- duckduckgo
tasks:
search_task:
description: Search for the latest AI developments in 2024
expected_output: A summary of key AI developments with sources
Serve API
from praisonaiagents import Agent
from praisonaiagents import duckduckgo
agent = Agent(
name="WebSearcher",
instructions="You are a web search agent.",
tools=[duckduckgo]
)
agent.launch(port=8080)
curl -X POST http://localhost:8080/chat \
-H "Content-Type: application/json" \
-d '{"message": "Search for Python 3.12 new features"}'
Advanced Workflow (All Features)
Agents: 1 — Single agent with memory, persistence, structured output, and session resumability.
Workflow
- Initialize session for resumable search context
- Configure SQLite persistence for search history
- Execute search with structured JSON output
- Store results in memory for follow-up queries
- Resume session to continue research
Setup
pip install praisonaiagents praisonai duckduckgo-search pydantic
export OPENAI_API_KEY="your-key"
Run — Python
from praisonaiagents import Agent, Task, AgentTeam, Session
from praisonaiagents import duckduckgo
from pydantic import BaseModel
# Structured output schema
class SearchResult(BaseModel):
query: str
summary: str
sources: list[str]
key_findings: list[str]
# Create session for resumability
session = Session(session_id="search-session-001", user_id="user-1")
# Agent with memory and tools
agent = Agent(
name="WebSearcher",
instructions="Search the web and return structured results.",
tools=[duckduckgo],
memory=True
)
# Task with structured output
task = Task(
description="Search for the latest AI developments in 2024",
expected_output="Structured search results",
agent=agent,
output_pydantic=SearchResult
)
# Run with SQLite persistence
agents = AgentTeam(
agents=[agent],
tasks=[task],
memory=True
)
result = agents.start()
print(result)
# Resume later
session2 = Session(session_id="search-session-001", user_id="user-1")
history = session2.search_memory("AI developments")
Run — CLI
# With memory and verbose
praisonai "Search for AI news" --web-search --memory --verbose
# Resume session
praisonai "Find more details" --web-search --memory --session search-001
Run — agents.yaml
framework: praisonai
topic: Web Research
memory: true
memory_config:
provider: sqlite
db_path: search.db
roles:
web_searcher:
role: Web Search Specialist
goal: Find and summarize web information
backstory: You are an expert at finding information online
tools:
- duckduckgo
memory: true
tasks:
search_task:
description: Search for the latest AI developments in 2024
expected_output: Structured search results
output_json:
query: string
summary: string
sources: array
key_findings: array
praisonai agents.yaml --verbose
Serve API
from praisonaiagents import Agent
from praisonaiagents import duckduckgo
agent = Agent(
name="WebSearcher",
instructions="Search the web and return results.",
tools=[duckduckgo],
memory=True
)
agent.launch(port=8080)
curl -X POST http://localhost:8080/chat \
-H "Content-Type: application/json" \
-d '{"message": "Search for Python news", "session_id": "search-001"}'
Monitor / Verify
praisonai "test search" --web-search --verbose
Cleanup
Features Demonstrated
| Feature | Implementation |
|---|
| Workflow | Single-step web search |
| DB Persistence | SQLite via memory_config |
| Observability | --verbose flag |
| Tools | DuckDuckGo search |
| Resumability | Session with session_id |
| Structured Output | Pydantic SearchResult model |
Next Steps