Self-improving AI Employees for everyone
Python ai-agentsai-employeeai-employeesassistantautonomous-agentsco-employeescompanygrok-botinstinctloop-agentsmuseown-your-datapersonalself-hosted
refactor: Rename webSearchTool to duckduckgoSearch and add search skills
trohitg4dda13453b5e
diff --git a/CLAUDE.md b/CLAUDE.mdindex 986c85d6..2545ee3f 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -364,14 +364,14 @@ class CacheEntry(SQLModel, table=True):## Codebase Summary- **Hybrid architecture**: Node.js + Python + React TypeScript-- **105 implemented workflow nodes** with clean service separation (6 AI models + 3 AI agents/memory + 13 specialized agents + 11 skills + 3 dedicated tools + 6 dual-purpose tools + 16 Android + 3 WhatsApp + 4 Twitter + 2 Social + 3 Location + 3 Code + 6 Utility + 6 Document + 2 Chat + 2 Scheduler + 1 Workflow + 26 Google Workspace + 1 Apify)+- **108 implemented workflow nodes** with clean service separation (6 AI models + 3 AI agents/memory + 13 specialized agents + 11 skills + 3 dedicated tools + 9 dual-purpose tools + 16 Android + 3 WhatsApp + 4 Twitter + 2 Social + 3 Location + 3 Code + 6 Utility + 6 Document + 2 Chat + 2 Scheduler + 1 Workflow + 26 Google Workspace + 1 Apify + 3 Search)- **WebSocket-First Architecture**: WebSocket as primary frontend-backend communication (87 message handlers)- **Recent optimizations**: REST APIs replaced with WebSocket, AI endpoints migrated to Python, Android automation integrated## Architecture RefactoringThe project was completely refactored from schema-based node definitions to explicit INodeProperties interface system inspired by n8n architecture. Key changes:- **Pure INodeProperties System**: Removed all backward compatibility layers-- **79 Implemented Node Components**: AI models, agents, skills, location services, Android automation, WhatsApp, Twitter/X, social, code execution, HTTP/Webhook utilities, document processing, chat, and schedulers+- **82 Implemented Node Components**: AI models, agents, skills, location services, Android automation, WhatsApp, Twitter/X, social, code execution, HTTP/Webhook utilities, document processing, chat, schedulers, and search- **WebSocket-First Communication**: 86 WebSocket message handlers replace most REST API calls- **Resource-Operation Pattern**: Organized by functional categories (AI, Location, Android, WhatsApp)- **TypeScript-First**: Full type safety with proper interface alignment@@ -390,7 +390,8 @@ The project was completely refactored from schema-based node definitions to expl- `src/nodeDefinitions/aiAgentNodes.ts` - AI agent and processing components- `src/nodeDefinitions/skillNodes.ts` - Skill node definitions (11 nodes including masterSkill and customSkill)- `src/nodeDefinitions/specializedAgentNodes.ts` - Specialized AI agent definitions (10 nodes) with shared AI_AGENT_PROPERTIES and centralized dracula theming-- `src/nodeDefinitions/toolNodes.ts` - AI Agent tool nodes (calculatorTool, currentTimeTool, webSearchTool)+- `src/nodeDefinitions/toolNodes.ts` - AI Agent tool nodes (calculatorTool, currentTimeTool, duckduckgoSearch)+- `src/nodeDefinitions/searchNodes.ts` - Search API nodes (braveSearch, serperSearch, perplexitySearch)- `src/nodeDefinitions/androidServiceNodes.ts` - 16 Android service nodes (monitoring, apps, automation, sensors, media)- `src/nodeDefinitions/locationNodes.ts` - Google Maps and location services- `src/nodeDefinitions/gmailNodes.ts` - Gmail integration (4 nodes)@@ -525,7 +526,7 @@ The project uses WebSocket as the primary communication method between frontend- `server/services/status_broadcaster.py` - Connection management and broadcasting## Implemented Node Types-The following 105 nodes are currently implemented and functional:+The following 108 nodes are currently implemented and functional:### AI Chat Models (6 nodes)- **openaiChatModel**: OpenAI GPT models with response format options. O-series models (o1, o3, o4) support reasoning effort parameter.@@ -538,7 +539,7 @@ The following 105 nodes are currently implemented and functional:### AI Agents & Memory (3 nodes)- **aiAgent**: Advanced AI agent with tool calling, memory input handle, and iterative reasoning. Uses LangGraph for structured execution. Parameters: Provider, Model, Prompt, System Message, Options.- **chatAgent**: Conversational AI agent with memory and skill support for multi-turn chat interactions. Parameters: Provider, Model, Prompt (supports `{{chatTrigger.message}}` template or auto-fallback from connected input), System Message. Behavior extended by connected skills.-### AI Agent Tool Nodes (5 dedicated + 6 dual-purpose)+### AI Agent Tool Nodes (5 dedicated + 9 dual-purpose)Tool nodes connect to AI Agent's `input-tools` handle to provide capabilities the agent can invoke during reasoning. Both `masterSkill` and `simpleMemory` are in the AI Tools category.#### Dedicated Tool Nodes (passive, tool-only)@@ -725,7 +726,34 @@ if skill_type == 'masterSkill':#### Other Dedicated Tool Nodes- **calculatorTool**: Mathematical operations (add, subtract, multiply, divide, power, sqrt, mod, abs)- **currentTimeTool**: Get current date/time with timezone support-- **webSearchTool**: Web search via DuckDuckGo (free, uses `ddgs` library) or Serper API with configurable max results+- **duckduckgoSearch**: DuckDuckGo web search (free, uses `ddgs` library, no API key required)++#### Dual-Purpose Search Nodes (workflow node + AI tool)+Search API nodes that work BOTH as standalone workflow nodes AND as AI Agent tools. When connected to `input-tools`, the LLM fills the node's parameter schema.+- **braveSearch**: **Dual-purpose node** - Search the web using Brave Search API. Returns web results with titles, snippets, and URLs. Group: `['search', 'tool']`. Parameters: query, maxResults, country, searchLang, safeSearch.+- **serperSearch**: **Dual-purpose node** - Search the web using Google via Serper API. Supports web, news, images, and places search types with knowledge graph. Group: `['search', 'tool']`. Parameters: query, searchType, maxResults, country, language.+- **perplexitySearch**: **Dual-purpose node** - AI-powered search using Perplexity Sonar. Returns a markdown-formatted AI answer with inline citation references and source URLs. Group: `['search', 'tool']`. Parameters: query, model (sonar/sonar-pro/sonar-reasoning/sonar-reasoning-pro), searchRecencyFilter, returnImages, returnRelatedQuestions.++**Key Files:**+| File | Description |+|------|-------------|+| `client/src/nodeDefinitions/searchNodes.ts` | 3 dual-purpose search node definitions |+| `server/services/handlers/search.py` | 3 handler functions with API key fetch + usage tracking |+| `server/services/handlers/tools.py` | Tool dispatch wrappers for AI Agent tool calling |+| `server/services/ai.py` | Tool names, descriptions, and Pydantic schemas |+| `server/constants.py` | `SEARCH_NODE_TYPES` and `SEARCH_TOOL_TYPES` constants |+| `client/src/assets/icons/search/` | SVG icons for Brave, Serper, Perplexity |++**Search API Authentication:**+| Provider | Credential Key | Header | API Endpoint |+|----------|---------------|--------|-------------|+| Brave Search | `brave_search` | `X-Subscription-Token` | `GET https://api.search.brave.com/res/v1/web/search` |+| Serper | `serper` | `X-API-KEY` | `POST https://google.serper.dev/search` |+| Perplexity | `perplexity` | `Authorization: Bearer` | `POST https://api.perplexity.ai/chat/completions` |++**Credentials Modal Layout:**+- Brave Search and Perplexity in **Search** category+- Serper in **Scrapers** category (Google SERP scraping)### Specialized AI Agents (13 nodes)Specialized agents are AI Agents pre-configured for specific domains. They inherit full AI Agent functionality (provider, model, prompt, system message, thinking/reasoning) while being tailored for specific capabilities. All specialized agents route to `handle_chat_agent` in the backend and support the same input handles. Node colors use centralized dracula theme constants imported from `client/src/styles/theme.ts`.@@ -1932,7 +1960,7 @@ Both AI Agent and Zeenie use the **same tool calling pattern**:1. **Tool Building**: Both use `_build_tool_from_node()` to create schema-only tools2. **Tool Execution**: Both use `execute_tool()` from `handlers/tools.py`-3. **Supported Tools**: `calculatorTool`, `currentTimeTool`, `webSearchTool`, `androidTool`, `httpRequest`+3. **Supported Tools**: `calculatorTool`, `currentTimeTool`, `duckduckgoSearch`, `androidTool`, `httpRequest`, `braveSearch`, `serperSearch`, `perplexitySearch`**Tool Execution Flow:**```@@ -3513,7 +3541,8 @@ Tool Node (calculatorTool) → (tool output) → AI Agent (input-tools handle)### Key Files| File | Description ||------|-------------|-| `client/src/nodeDefinitions/toolNodes.ts` | Tool node definitions (calculatorTool, currentTimeTool, webSearchTool, androidTool) |+| `client/src/nodeDefinitions/toolNodes.ts` | Tool node definitions (calculatorTool, currentTimeTool, duckduckgoSearch, androidTool) |+| `client/src/nodeDefinitions/searchNodes.ts` | Search node definitions (braveSearch, serperSearch, perplexitySearch) || `client/src/nodeDefinitions/specializedAgentNodes.ts` | Specialized agent definitions (10 nodes) + AI_AGENT_PROPERTIES + SPECIALIZED_AGENT_TYPES || `server/services/handlers/tools.py` | Tool execution handlers || `server/services/ai.py` | `_get_tool_schema()` - Pydantic schemas for tools |@@ -3593,7 +3622,10 @@ Tool nodes display execution status via the standard node status system:|------|--------|---------|-------------|| calculatorTool | CalculatorSchema | `_execute_calculator()` | Math operations || currentTimeTool | CurrentTimeSchema | `_execute_current_time()` | Date/time with timezone |-| webSearchTool | WebSearchSchema | `_execute_web_search()` | DuckDuckGo/Serper search |+| duckduckgoSearch | DuckDuckGoSearchSchema | `_execute_duckduckgo_search()` | DuckDuckGo web search (free) |+| braveSearch | BraveSearchSchema | `handle_brave_search()` | Brave Search API web results |+| serperSearch | SerperSearchSchema | `handle_serper_search()` | Google SERP via Serper API |+| perplexitySearch | PerplexitySearchSchema | `handle_perplexity_search()` | AI-powered search with citations || androidTool | AndroidToolSchema | `_execute_android_toolkit()` | Android device control via connected services || Android service nodes | Per-service schema | `_execute_android_service()` | Direct Android service tools (see below) |@@ -3700,18 +3732,25 @@ When no custom schema exists, service-specific defaults are generated:```### Web Search Implementation-Uses `ddgs` library (renamed from `duckduckgo-search`) for actual web results (not the limited Instant Answer API):++#### DuckDuckGo (duckduckgoSearch - free, no API key)+Uses `ddgs` library for web results:```pythonfrom ddgs import DDGS-def do_search():ddgs = DDGS()return list(ddgs.text(query, max_results=max_results))--# Run in thread pool to avoid blocking asyncsearch_results = await asyncio.get_event_loop().run_in_executor(None, do_search)```+#### Search API Nodes (braveSearch, serperSearch, perplexitySearch)+Dedicated handlers in `server/services/handlers/search.py` using `httpx.AsyncClient`:+- **Brave Search**: `GET https://api.search.brave.com/res/v1/web/search` with `X-Subscription-Token` header. Returns `{query, results: [{title, snippet, url}], result_count, provider}`.+- **Serper**: `POST https://google.serper.dev/search` with `X-API-KEY` header. Supports web/news/images/places search types. Returns `{query, results, result_count, search_type, provider}` with optional `knowledge_graph`.+- **Perplexity Sonar**: `POST https://api.perplexity.ai/chat/completions` with Bearer token. Returns `{query, answer (markdown), citations: [url], results: [{url}], model, provider}` with optional `images` and `related_questions`.++All handlers fetch API keys via `auth_service.get_api_key()` and track usage via `_track_search_usage()` for cost calculation.+## Config Node Architecture### Overviewdiff --git a/client/src/assets/icons/search/duckduckgo.svg b/client/src/assets/icons/search/duckduckgo.svgnew file mode 100644index 00000000..a816a6b4--- /dev/null+++ b/client/src/assets/icons/search/duckduckgo.svg@@ -0,0 +1 @@+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="64" height="64" viewBox="0 0 32 32"><g transform="matrix(.266667 0 0 .266667 -17.954934 -5.057333)"><circle cx="127.332" cy="78.966" r="51.15" fill="#de5833"/><defs><path id="A" d="M178.684 78.824c0 28.316-23.035 51.354-51.354 51.354-28.313 0-51.348-23.04-51.348-51.354s23.036-51.35 51.348-51.35c28.318 0 51.354 23.036 51.354 51.35z"/></defs><clipPath id="B"><use xlink:href="#A"/></clipPath><g clip-path="url(#B)"><path d="M148.293 155.158c-1.8-8.285-12.262-27.04-16.23-34.97s-7.938-19.1-6.13-26.322c.328-1.312-3.436-11.308-2.354-12.015 8.416-5.5 10.632.6 14.002-1.862 1.734-1.273 4.1 1.047 4.7-1.06 2.158-7.567-3.006-20.76-8.77-26.526-1.885-1.88-4.77-3.06-8.03-3.687-1.254-1.713-3.275-3.36-6.138-4.88-3.188-1.697-10.12-3.938-13.717-4.535-2.492-.4-3.055.287-4.12.46.992.088 5.7 2.414 6.615 2.55-.916.62-3.607-.028-5.324.742-.865.392-1.512 1.877-1.506 2.58 4.9-.496 12.574-.016 17.1 2-3.602.4-9.08.867-11.436 2.105-6.848 3.608-9.873 12.035-8.07 22.133 1.804 10.075 9.738 46.85 12.262 59.13 2.525 12.264-5.408 20.2-10.455 22.354l5.408.363-1.8 3.967c6.484.72 13.695-1.44 13.695-1.44-1.438 3.965-11.176 5.412-11.176 5.412s4.7 1.438 12.258-1.447l12.263-4.688 3.604 9.373 6.854-6.847 2.885 7.2c.014-.001 5.424-1.808 3.62-10.103z" fill="#d5d7d8"/><path d="M150.47 153.477c-1.795-8.3-12.256-27.043-16.228-34.98s-7.935-19.112-6.13-26.32c.335-1.3.34-6.668 1.43-7.38 8.4-5.494 7.812-.184 11.187-2.645 1.74-1.27 3.133-2.806 3.738-4.912 2.164-7.572-3.006-20.76-8.773-26.53-1.88-1.88-4.768-3.062-8.023-3.686-1.252-1.718-3.27-3.36-6.13-4.882-5.4-2.862-12.074-4.006-18.266-2.883 1 .1 3.256 2.138 4.168 2.273-1.38.936-5.053.815-5.03 2.896 4.916-.492 10.303.285 14.834 2.297-3.602.4-6.955 1.3-9.3 2.543-6.854 3.603-8.656 10.812-6.854 20.914 1.807 10.097 9.742 46.873 12.256 59.126 2.527 12.26-5.402 20.188-10.45 22.354l5.408.36-1.8 3.973c6.484.72 13.695-1.44 13.695-1.44-1.438 3.974-11.176 5.406-11.176 5.406s4.686 1.44 12.258-1.445l12.27-4.688 3.604 9.373 6.852-6.85 2.9 7.215c-.016.007 5.388-1.797 3.58-10.088z" fill="#fff"/><path d="M109.02 70.69c0-2.093 1.693-3.787 3.79-3.787 2.1 0 3.785 1.694 3.785 3.787s-1.695 3.786-3.785 3.786c-2.096.001-3.79-1.692-3.79-3.786z" fill="#2d4f8e"/><path d="M113.507 69.43a.98.98 0 0 1 .98-.983c.543 0 .984.438.984.983s-.44.984-.984.984c-.538.001-.98-.44-.98-.984z" fill="#fff"/><path d="M134.867 68.445c0-1.793 1.46-3.25 3.252-3.25 1.8 0 3.256 1.457 3.256 3.25 0 1.8-1.455 3.258-3.256 3.258a3.26 3.26 0 0 1-3.252-3.258z" fill="#2d4f8e"/><path d="M138.725 67.363c0-.463.38-.843.838-.843a.84.84 0 0 1 .846.843c0 .47-.367.842-.846.842a.84.84 0 0 1-.838-.842z" fill="#fff"/><linearGradient id="C" gradientUnits="userSpaceOnUse" x1="105.318" y1="60.979" x2="113.887" y2="60.979"><stop offset=".006" stop-color="#6176b9"/><stop offset=".691" stop-color="#394a9f"/></linearGradient><path d="M113.886 59.718s-2.854-1.3-5.63.453-2.668 3.523-2.668 3.523-1.473-3.283 2.453-4.892 5.844.916 5.844.916z" fill="url(#C)"/><linearGradient id="D" gradientUnits="userSpaceOnUse" x1="132.273" y1="58.371" x2="140.078" y2="58.371"><stop offset=".006" stop-color="#6176b9"/><stop offset=".691" stop-color="#394a9f"/></linearGradient><path d="M140.078 59.458s-2.05-1.172-3.643-1.152c-3.27.043-4.162 1.488-4.162 1.488s.55-3.445 4.732-2.754c2.268.377 3.073 2.418 3.073 2.418z" fill="url(#D)"/></g><path d="M124.4 85.295c.38-2.3 6.3-6.625 10.5-6.887 4.2-.265 5.5-.205 9-1.043s12.535-3.088 15.033-4.242c2.504-1.156 13.104.572 5.63 4.738-3.232 1.8-11.943 5.13-18.172 6.987-6.22 1.86-10-1.776-12.06 1.28-1.646 2.432-.334 5.762 7.1 6.453 10.037.93 19.66-4.52 20.72-1.625s-8.625 6.508-14.525 6.623c-5.893.1-17.77-3.896-19.555-5.137s-4.165-4.13-3.67-7.148z" fill="#fdd20a"/><path d="M128.943 115.592s-14.102-7.52-14.332-4.47c-.238 3.056 0 15.5 1.643 16.45s13.396-6.108 13.396-6.108zm5.403-.474s9.635-7.285 11.754-6.815c2.1.48 2.582 15.5.7 16.23-1.88.7-12.908-3.813-12.908-3.813z" fill="#65bc46"/><path d="M125.53 116.4c0 4.932-.7 7.05 1.4 7.52s6.104 0 7.518-.938.232-7.28-.232-8.465c-.477-1.174-8.696-.232-8.696 1.884z" fill="#43a244"/><path d="M126.426 115.292c0 4.933-.707 7.05 1.4 7.52 2.106.48 6.104 0 7.52-.938 1.4-.94.23-7.28-.236-8.466-.473-1.173-8.692-.227-8.692 1.885z" fill="#65bc46"/><circle cx="127.331" cy="78.965" r="57.5" fill="none" stroke="#de5833" stroke-width="5"/></g></svg>\ No newline at end of filediff --git a/client/src/assets/icons/search/index.ts b/client/src/assets/icons/search/index.tsindex bdd21b35..ec676ec7 100644--- a/client/src/assets/icons/search/index.ts+++ b/client/src/assets/icons/search/index.ts@@ -2,6 +2,7 @@// Based on n8n's implementation using SVG filesimport braveSvg from './brave.svg?raw';+import duckduckgoSvg from './duckduckgo.svg?raw';import googleSvg from './google.svg?raw';import perplexitySvg from './perplexity.svg?raw';@@ -14,12 +15,14 @@ const svgToDataUri = (svg: string): string => {};export const BRAVE_SEARCH_ICON = svgToDataUri(braveSvg);+export const DUCKDUCKGO_ICON = svgToDataUri(duckduckgoSvg);export const SERPER_ICON = svgToDataUri(googleSvg);export const PERPLEXITY_ICON = svgToDataUri(perplexitySvg);// Export raw SVGs for React component usageexport const SearchIcons = {brave: braveSvg,+ duckduckgo: duckduckgoSvg,serper: googleSvg,perplexity: perplexitySvg,};diff --git a/client/src/components/CredentialsModal.tsx b/client/src/components/CredentialsModal.tsxindex 4f4fda03..6982ba6c 100644--- a/client/src/components/CredentialsModal.tsx+++ b/client/src/components/CredentialsModal.tsx@@ -128,6 +128,12 @@ const CATEGORIES: Category[] = [items: [{ id: 'whatsapp_personal', name: 'WhatsApp Personal', placeholder: '', color: '#25D366', desc: 'Connect via QR code pairing', CustomIcon: WhatsAppIcon, isSpecial: true, panelType: 'whatsapp' },{ id: 'twitter', name: 'Twitter/X', placeholder: '', color: '#000000', desc: 'Post tweets, search, user lookup', CustomIcon: XIcon, isSpecial: true, panelType: 'twitter' },+ ],+ },+ {+ key: 'productivity',+ label: 'Productivity',+ items: [{ id: 'gmail', name: 'Google Workspace', placeholder: '', color: '#4285F4', desc: 'Gmail, Calendar, Drive, Sheets, Tasks, Contacts', CustomIcon: GoogleWorkspaceIcon, isSpecial: true, panelType: 'gmail' },],},@@ -142,9 +148,16 @@ const CATEGORIES: Category[] = [key: 'search',label: 'Search',items: [- { id: 'brave_search', name: 'Brave Search', placeholder: 'BSA...', color: '#FB542B', desc: 'Web search via Brave Search API' },- { id: 'serper', name: 'Serper', placeholder: '', color: '#4285F4', desc: 'Google search via Serper API' },- { id: 'perplexity', name: 'Perplexity', placeholder: 'pplx-...', color: '#20808D', desc: 'AI-powered search with citations' },+ { id: 'brave_search', name: 'Brave Search', placeholder: 'BSA...', color: '#FB542B', desc: 'Web search via Brave Search API', CustomIcon: BraveSearchIcon },+ { id: 'perplexity', name: 'Perplexity', placeholder: 'pplx-...', color: '#20808D', desc: 'AI-powered search with citations', CustomIcon: PerplexitySearchIcon },+ ],+ },+ {+ key: 'scrapers',+ label: 'Scrapers',+ items: [+ { id: 'apify', name: 'Apify', placeholder: 'apify_api_...', color: '#246DFF', desc: 'Web scraping, social media extraction', CustomIcon: ApifyIcon },+ { id: 'serper', name: 'Serper', placeholder: '', color: '#4285F4', desc: 'Google SERP scraping via Serper API', CustomIcon: SerperSearchIcon },],},{@@ -152,7 +165,6 @@ const CATEGORIES: Category[] = [label: 'Services',items: [{ id: 'google_maps', name: 'Google Maps', placeholder: 'AIza...', color: '#EA4335', desc: 'Geocoding, Places, Directions', CustomIcon: GoogleMapsIcon, panelType: 'google_maps' },- { id: 'apify', name: 'Apify', placeholder: 'apify_api_...', color: '#246DFF', desc: 'Web scraping, social media extraction', CustomIcon: ApifyIcon },],},];diff --git a/client/src/components/parameterPanel/MiddleSection.tsx b/client/src/components/parameterPanel/MiddleSection.tsxindex 0a4a461b..a1420319 100644--- a/client/src/components/parameterPanel/MiddleSection.tsx+++ b/client/src/components/parameterPanel/MiddleSection.tsx@@ -14,7 +14,7 @@ import { Edge } from 'reactflow';import { SKILL_NODE_TYPES, skillNodes } from '../../nodeDefinitions/skillNodes';// Tool node types that support schema editing-const TOOL_NODE_TYPES = ['androidTool', 'calculatorTool', 'currentTimeTool', 'webSearchTool'];+const TOOL_NODE_TYPES = ['androidTool', 'calculatorTool', 'currentTimeTool', 'duckduckgoSearch'];// Agent node types that support skills (have input-skill handle)const AGENT_WITH_SKILLS_TYPES = [diff --git a/client/src/components/ui/NodeOutputPanel.tsx b/client/src/components/ui/NodeOutputPanel.tsxindex 9714b4bc..adc62a7a 100644--- a/client/src/components/ui/NodeOutputPanel.tsx+++ b/client/src/components/ui/NodeOutputPanel.tsx@@ -1,9 +1,16 @@import React, { useState } from 'react';+import { Card, List, Tag, Typography, Space } from 'antd';+import { SearchOutlined, LinkOutlined, StarFilled, QuestionCircleOutlined, BookOutlined, RobotOutlined } from '@ant-design/icons';+import ReactMarkdown from 'react-markdown';+import remarkGfm from 'remark-gfm';+import remarkBreaks from 'remark-breaks';import { useAppTheme } from '../../hooks/useAppTheme';import { ExecutionResult } from '../../services/executionService';import { Node } from 'reactflow';import { copyToClipboard } from '../../utils/formatters';+const { Text, Paragraph, Link: AntLink } = Typography;+// Simple JSON syntax highlighter using Dracula colorsconst highlightJSON = (json: string, dracula: any): React.ReactNode => {const lines = json.split('\n');@@ -175,7 +182,8 @@ const NodeOutputPanel: React.FC<NodeOutputPanelProps> = ({type MapsNearbyOutput = { type: 'maps_nearby'; places: any[]; searchParams: any; total: number };type MapsGeocodeOutput = { type: 'maps_geocode'; locations: any[]; total: number };type MapsCreateOutput = { type: 'maps_create'; mapUrl: string; center: { lat: number; lng: number }; zoom: number; mapType: string };- type StructuredOutput = AndroidOutput | WhatsAppHistoryOutput | MapsNearbyOutput | MapsGeocodeOutput | MapsCreateOutput;+ type SearchResultsOutput = { type: 'search_results'; query: string; results: any[]; resultCount: number; provider: string; answer?: string; citations?: string[]; searchType?: string; knowledgeGraph?: any; images?: string[]; relatedQuestions?: string[] };+ type StructuredOutput = AndroidOutput | WhatsAppHistoryOutput | MapsNearbyOutput | MapsGeocodeOutput | MapsCreateOutput | SearchResultsOutput;// Extract the main response text from execution resultsconst getMainResponse = (result: ExecutionResult): string | StructuredOutput | null => {@@ -203,6 +211,39 @@ const NodeOutputPanel: React.FC<NodeOutputPanelProps> = ({if (data?.messages !== undefined && data?.total !== undefined) {return { type: 'whatsapp_history', messages: data.messages, total: data.total, count: data.count || data.messages?.length, hasMore: data.has_more };}+ // Search results output (Brave Search, Serper, Perplexity, DuckDuckGo)+ // Check nested result structure: { success, result: { query, results, provider } }+ if (data?.result?.results !== undefined && data?.result?.query !== undefined) {+ return {+ type: 'search_results',+ query: data.result.query,+ results: data.result.results,+ resultCount: data.result.result_count || data.result.results.length,+ provider: data.result.provider || 'search',+ answer: data.result.answer,+ citations: data.result.citations,+ searchType: data.result.search_type,+ knowledgeGraph: data.result.knowledge_graph,+ images: data.result.images,+ relatedQuestions: data.result.related_questions,+ };+ }+ // Search results top-level (tool direct return or unwrapped by useExecution)+ if (data?.results !== undefined && data?.query !== undefined && Array.isArray(data?.results)) {+ return {+ type: 'search_results',+ query: data.query,+ results: data.results,+ resultCount: data.result_count || data.results.length,+ provider: data.provider || 'search',+ answer: data.answer,+ citations: data.citations,+ searchType: data.search_type,+ knowledgeGraph: data.knowledge_graph,+ images: data.images,+ relatedQuestions: data.related_questions,+ };+ }// Google Maps nearby places output// Check nested result structure (from backend: { success, result: { results, search_parameters } })if (data?.result?.results !== undefined && data?.result?.search_parameters !== undefined) {@@ -986,6 +1027,277 @@ const NodeOutputPanel: React.FC<NodeOutputPanelProps> = ({</a></div></div>+ ) : mainResponse && typeof mainResponse === 'object' && (mainResponse as any).type === 'search_results' ? (+ /* Search Results Response (Brave, Serper, Perplexity, DuckDuckGo) */+ (() => {+ const sr = mainResponse as SearchResultsOutput;+ const providerColors: Record<string, string> = {+ brave_search: '#FB542B', serper: '#4285F4', perplexity: '#20808D', duckduckgo: '#DE5833',+ };+ const providerLabels: Record<string, string> = {+ brave_search: 'Brave Search', serper: 'Serper', perplexity: 'Perplexity', duckduckgo: 'DuckDuckGo',+ };+ const accent = providerColors[sr.provider] || theme.dracula.cyan;+ const hasRichResults = sr.results.some((r: any) => r.title || r.snippet);+ const showResultsList = !sr.answer || hasRichResults;+ return (+ <div style={{ marginBottom: theme.spacing.md }}>+ {/* Header card */}+ <Card+ size="small"+ style={{+ backgroundColor: theme.colors.backgroundElevated,+ border: `1px solid ${accent}40`,+ borderLeft: `3px solid ${accent}`,+ borderRadius: `${theme.borderRadius.md} ${theme.borderRadius.md} 0 0`,+ }}+ bodyStyle={{ padding: `${theme.spacing.sm} ${theme.spacing.md}` }}+ >+ <Space direction="vertical" size={4} style={{ width: '100%' }}>+ <Space style={{ width: '100%', justifyContent: 'space-between' }}>+ <Space size="small">+ <SearchOutlined style={{ color: accent }} />+ <Text strong style={{ color: accent, fontSize: theme.fontSize.xs, textTransform: 'uppercase', letterSpacing: '0.1em' }}>+ Search Results+ </Text>+ <Tag color={accent} style={{ margin: 0 }}>+ {providerLabels[sr.provider] || sr.provider}+ </Tag>+ </Space>+ <Space size="middle">+ <Text type="secondary" style={{ fontSize: theme.fontSize.xs }}>+ <Text style={{ color: accent }}>{sr.resultCount}</Text> result{sr.resultCount !== 1 ? 's' : ''}+ </Text>+ {sr.searchType && sr.searchType !== 'search' && (+ <Tag>{sr.searchType}</Tag>+ )}+ </Space>+ </Space>+ <Text type="secondary" style={{ fontSize: theme.fontSize.sm }}>+ Query: <Text style={{ color: theme.colors.text }}>{sr.query}</Text>+ </Text>+ </Space>+ </Card>++ {/* Perplexity AI answer */}+ {sr.answer && (+ <Card+ size="small"+ style={{+ backgroundColor: theme.colors.backgroundElevated,+ borderLeft: `3px solid ${accent}`,+ border: `1px solid ${accent}40`,+ borderTop: 'none',+ borderRadius: !showResultsList && !sr.knowledgeGraph ? `0 0 ${theme.borderRadius.md} ${theme.borderRadius.md}` : 0,+ }}+ bodyStyle={{ padding: theme.spacing.md }}+ >+ <Space direction="vertical" size="small" style={{ width: '100%' }}>+ <Space size="small">+ <RobotOutlined style={{ color: accent }} />+ <Text strong style={{ color: accent, fontSize: theme.fontSize.xs, textTransform: 'uppercase', letterSpacing: '0.05em' }}>+ AI Answer+ </Text>+ </Space>+ <div+ className="search-answer-markdown"+ style={{ color: theme.colors.text, fontSize: theme.fontSize.sm, lineHeight: 1.6 }}+ >+ <style>{`+ .search-answer-markdown p { margin: 0 0 8px 0; }+ .search-answer-markdown p:last-child { margin-bottom: 0; }+ .search-answer-markdown h1, .search-answer-markdown h2, .search-answer-markdown h3 {+ margin: 12px 0 8px 0; font-weight: 600; color: ${theme.colors.text};+ }+ .search-answer-markdown h1:first-child, .search-answer-markdown h2:first-child, .search-answer-markdown h3:first-child { margin-top: 0; }+ .search-answer-markdown h1 { font-size: 1.2em; }+ .search-answer-markdown h2 { font-size: 1.1em; }+ .search-answer-markdown h3 { font-size: 1em; }+ .search-answer-markdown strong { font-weight: 600; color: ${theme.colors.text}; }+ .search-answer-markdown em { font-style: italic; }+ .search-answer-markdown ul, .search-answer-markdown ol { margin: 8px 0; padding-left: 20px; }+ .search-answer-markdown li { margin: 4px 0; }+ .search-answer-markdown code {+ background-color: ${theme.isDarkMode ? theme.dracula.currentLine : `${theme.colors.border}50`};+ padding: 2px 6px; border-radius: 4px;+ font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace;+ font-size: 0.9em;+ }+ .search-answer-markdown pre {+ background-color: ${theme.isDarkMode ? theme.dracula.currentLine : theme.colors.backgroundPanel};+ padding: 12px; border-radius: 6px; overflow-x: auto; margin: 8px 0;+ }+ .search-answer-markdown pre code { background: none; padding: 0; }+ .search-answer-markdown table { border-collapse: collapse; margin: 8px 0; width: 100%; font-size: 0.9em; }+ .search-answer-markdown th, .search-answer-markdown td {+ border: 1px solid ${theme.isDarkMode ? theme.dracula.selection : theme.colors.border};+ padding: 6px 10px; text-align: left;+ }+ .search-answer-markdown th {+ background-color: ${theme.isDarkMode ? theme.dracula.currentLine : theme.colors.backgroundPanel};+ font-weight: 600;+ }+ .search-answer-markdown blockquote {+ border-left: 3px solid ${accent};+ margin: 8px 0; padding: 4px 12px; color: ${theme.colors.textSecondary};+ }+ .search-answer-markdown a { color: ${accent}; text-decoration: none; }+ .search-answer-markdown a:hover { text-decoration: underline; }+ .search-answer-markdown hr {+ border: none;+ border-top: 1px solid ${theme.isDarkMode ? theme.dracula.selection : theme.colors.border};+ margin: 12px 0;+ }+ `}</style>+ <ReactMarkdown remarkPlugins={[remarkGfm, remarkBreaks]}>+ {sr.answer}+ </ReactMarkdown>+ </div>+ {sr.citations && sr.citations.length > 0 && (+ <Space size={[4, 4]} wrap>+ {sr.citations.map((url: string, idx: number) => (+ <Tag+ key={idx}+ icon={<LinkOutlined />}+ color={accent}+ style={{ cursor: 'pointer', maxWidth: 200, overflow: 'hidden', textOverflow: 'ellipsis' }}+ onClick={() => window.open(url, '_blank')}+ title={url}+ >+ {(() => { try { return new URL(url).hostname; } catch { return url; } })()}+ </Tag>+ ))}+ </Space>+ )}+ </Space>+ </Card>+ )}++ {/* Knowledge graph (Serper) */}+ {sr.knowledgeGraph && (+ <Card+ size="small"+ style={{+ backgroundColor: theme.colors.backgroundElevated,+ borderLeft: `3px solid ${accent}`,+ border: `1px solid ${accent}40`,+ borderTop: 'none',+ borderRadius: 0,+ }}+ bodyStyle={{ padding: theme.spacing.md }}+ >+ <Space direction="vertical" size={2} style={{ width: '100%' }}>+ <Space size="small">+ <BookOutlined style={{ color: accent }} />+ <Text strong style={{ color: accent, fontSize: theme.fontSize.xs, textTransform: 'uppercase', letterSpacing: '0.05em' }}>+ Knowledge Graph+ </Text>+ </Space>+ {sr.knowledgeGraph.title && (+ <Text strong style={{ color: theme.colors.text }}>{sr.knowledgeGraph.title}</Text>+ )}+ {sr.knowledgeGraph.type && (+ <Text type="secondary" style={{ fontSize: theme.fontSize.xs }}>{sr.knowledgeGraph.type}</Text>+ )}+ {sr.knowledgeGraph.description && (+ <Paragraph style={{ color: theme.colors.textSecondary, fontSize: theme.fontSize.sm, lineHeight: 1.5, marginBottom: 0 }}>+ {sr.knowledgeGraph.description}+ </Paragraph>+ )}+ </Space>+ </Card>+ )}++ {/* Results list - skip when answer+citations already cover it (Perplexity returns url-only results) */}+ {showResultsList && (+ <List+ size="small"+ dataSource={sr.results}+ locale={{ emptyText: 'No results found' }}+ style={{+ backgroundColor: theme.colors.backgroundElevated,+ border: `1px solid ${accent}40`,+ borderTop: 'none',+ borderRadius: `0 0 ${theme.borderRadius.md} ${theme.borderRadius.md}`,+ maxHeight: 400,+ overflow: 'auto',+ }}+ renderItem={(item: any, idx: number) => (+ <List.Item+ key={idx}+ style={{ padding: `${theme.spacing.sm} ${theme.spacing.md}`, alignItems: 'flex-start' }}+ >+ <Space direction="vertical" size={2} style={{ width: '100%' }}>+ <Space size="small" align="start">+ {item.position && (+ <Text type="secondary" style={{ fontSize: 10, minWidth: 18 }}>#{item.position}</Text>+ )}+ {item.title ? (+ <AntLink href={item.url || item.imageUrl} target="_blank" style={{ color: accent, fontSize: theme.fontSize.sm, fontWeight: theme.fontWeight.medium }}>+ {item.title}+ </AntLink>+ ) : item.url ? (+ <AntLink href={item.url} target="_blank" style={{ color: accent, fontSize: theme.fontSize.sm, wordBreak: 'break-all' }}>+ {item.url}+ </AntLink>+ ) : null}+ </Space>+ {item.snippet && (+ <Text type="secondary" style={{ fontSize: theme.fontSize.xs, lineHeight: 1.4 }}>+ {item.snippet}+ </Text>+ )}+ {item.url && item.title && (+ <Text type="secondary" style={{ fontSize: 11, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', display: 'block' }}>+ {item.url}+ </Text>+ )}+ {(item.date || item.source || item.address || item.rating != null) && (+ <Space size="small">+ {item.source && <Tag color="cyan">{item.source}</Tag>}+ {item.date && <Text type="secondary" style={{ fontSize: 10 }}>{item.date}</Text>}+ {item.address && <Text type="secondary" style={{ fontSize: 10 }}>{item.address}</Text>}+ {item.rating != null && (+ <Tag icon={<StarFilled />} color="gold">{item.rating}</Tag>+ )}+ </Space>+ )}+ </Space>+ </List.Item>+ )}+ />+ )}++ {/* Related questions (Perplexity) */}+ {sr.relatedQuestions && sr.relatedQuestions.length > 0 && (+ <Card+ size="small"+ style={{+ marginTop: theme.spacing.sm,+ backgroundColor: theme.colors.backgroundElevated,+ border: `1px solid ${accent}30`,+ borderRadius: theme.borderRadius.md,+ }}+ bodyStyle={{ padding: theme.spacing.md }}+ >+ <Space direction="vertical" size="small" style={{ width: '100%' }}>+ <Space size="small">+ <QuestionCircleOutlined style={{ color: accent }} />+ <Text strong style={{ color: accent, fontSize: theme.fontSize.xs, textTransform: 'uppercase', letterSpacing: '0.05em' }}>+ Related Questions+ </Text>+ </Space>+ {sr.relatedQuestions.map((q: string, idx: number) => (+ <Tag key={idx} style={{ whiteSpace: 'normal', padding: `${theme.spacing.xs} ${theme.spacing.sm}` }}>+ {q}+ </Tag>+ ))}+ </Space>+ </Card>+ )}+ </div>+ );+ })()) : mainResponse && (/* Standard Response (AI, etc) */<div style={{diff --git a/client/src/nodeDefinitions/toolNodes.ts b/client/src/nodeDefinitions/toolNodes.tsindex e6570971..312ad5e9 100644--- a/client/src/nodeDefinitions/toolNodes.ts+++ b/client/src/nodeDefinitions/toolNodes.ts@@ -3,6 +3,7 @@ import {INodeTypeDescription,NodeConnectionType,} from '../types/INodeProperties';+import { DUCKDUCKGO_ICON } from '../assets/icons/search';// ============================================================================// TOOL NODES - Connect to AI Agent's input-tools handle@@ -91,16 +92,16 @@ export const toolNodes: Record<string, INodeTypeDescription> = {]},- // Web Search Tool - allows AI Agent to search the web- webSearchTool: {- displayName: 'Web Search Tool',- name: 'webSearchTool',- icon: '🔍',+ // DuckDuckGo Search Tool - allows AI Agent to search the web (free, no API key)+ duckduckgoSearch: {+ displayName: 'DuckDuckGo Search',+ name: 'duckduckgoSearch',+ icon: DUCKDUCKGO_ICON,group: ['tool', 'ai'],version: 1,- subtitle: 'Web Search',- description: 'Allow AI Agent to search the web for information',- defaults: { name: 'Web Search', color: '#bd93f9' },+ subtitle: 'Free Web Search',+ description: 'Allow AI Agent to search the web for free via DuckDuckGo (no API key required)',+ defaults: { name: 'DuckDuckGo', color: '#DE5833' },inputs: [],outputs: [{name: 'tool',@@ -125,30 +126,6 @@ export const toolNodes: Record<string, INodeTypeDescription> = {typeOptions: { rows: 2 },description: 'Describe the tool capabilities for the AI'},- {- displayName: 'Search Provider',- name: 'provider',- type: 'options',- options: [- { name: 'DuckDuckGo (Free)', value: 'duckduckgo' },- { name: 'Serper API', value: 'serper' },- { name: 'Google Custom Search', value: 'google' }- ],- default: 'duckduckgo',- description: 'Search provider to use'- },- {- displayName: 'API Key',- name: 'apiKey',- type: 'string',- default: '',- description: 'API key for Serper or Google (not needed for DuckDuckGo)',- displayOptions: {- show: {- provider: ['serper', 'google']- }- }- },{displayName: 'Max Results',name: 'maxResults',@@ -252,4 +229,4 @@ export const toolNodes: Record<string, INodeTypeDescription> = {// ============================================================================// List of tool node types for identification-export const TOOL_NODE_TYPES = ['calculatorTool', 'currentTimeTool', 'webSearchTool', 'taskManager'];+export const TOOL_NODE_TYPES = ['calculatorTool', 'currentTimeTool', 'duckduckgoSearch', 'taskManager'];diff --git a/client/src/services/executionService.ts b/client/src/services/executionService.tsindex 35fffc79..d79dc31c 100644--- a/client/src/services/executionService.ts+++ b/client/src/services/executionService.ts@@ -13,6 +13,7 @@ import { SHEETS_NODE_TYPES } from '../nodeDefinitions/sheetsNodes';import { TASKS_NODE_TYPES } from '../nodeDefinitions/tasksNodes';import { CONTACTS_NODE_TYPES } from '../nodeDefinitions/contactsNodes';import { APIFY_NODE_TYPES } from '../nodeDefinitions/apifyNodes';+import { SEARCH_NODE_TYPES } from '../nodeDefinitions/searchNodes';import { Node, Edge } from 'reactflow';import { INodeExecutionData } from '../types/INodeProperties';import { API_CONFIG } from '../config/api';@@ -242,7 +243,9 @@ export class ExecutionService {...TASKS_NODE_TYPES,...CONTACTS_NODE_TYPES,// Apify web scraping- ...APIFY_NODE_TYPES+ ...APIFY_NODE_TYPES,+ // Search API nodes+ ...SEARCH_NODE_TYPES];return supportedTypes.includes(nodeType);diff --git a/docs-internal/agent_architecture.md b/docs-internal/agent_architecture.mdindex 5262e17d..dbb3cf55 100644--- a/docs-internal/agent_architecture.md+++ b/docs-internal/agent_architecture.md@@ -385,12 +385,15 @@ For `androidTool` (toolkit pattern), edges are scanned a second time to find And| `calculatorTool` | `calculator` | `CalculatorSchema(operation, a, b)` || `currentTimeTool` | `get_current_time` | `CurrentTimeSchema(timezone)` || `timer` | `timer` | `TimerSchema(delay, unit)` |-| `webSearchTool` | `web_search` | `WebSearchSchema(query, max_results)` |+| `duckduckgoSearch` | `web_search` | `DuckDuckGoSearchSchema(query, max_results)` || `pythonExecutor` | `python_code` | `PythonCodeSchema(code)` || `javascriptExecutor` | `javascript_code` | `JavaScriptCodeSchema(code)` || `httpRequest` | `http_request` | `HttpRequestSchema(url, method, body)` || `whatsappSend` | `whatsapp_send` | `WhatsAppSendSchema(recipient_type, phone, message_type, message, ...)` || `whatsappDb` | `whatsapp_db` | `WhatsAppDbSchema(operation, chat_id, query, limit)` |+| `braveSearch` | `brave_search` | `BraveSearchSchema(query, max_results, country, safe_search)` |+| `serperSearch` | `serper_search` | `SerperSearchSchema(query, max_results, search_type, country)` |+| `perplexitySearch` | `perplexity_search` | `PerplexitySearchSchema(query, model, search_recency_filter)` || `gmaps_locations` | `geocode` | `GeocodeSchema(address)` || `gmaps_nearby_places` | `nearby_places` | `NearbyPlacesSchema(location, type, radius)` || `androidTool` | `android_device` | `AndroidToolSchema(service_id, action, parameters)` |@@ -487,7 +490,10 @@ async def execute_tool(tool_name, tool_args, config):elif node_type == 'javascriptExecutor': return await _execute_javascript_code(tool_args, config['parameters'])elif node_type == 'currentTimeTool': return await _execute_current_time(tool_args)elif node_type == 'timer': return await handle_timer(...)- elif node_type == 'webSearchTool': return await _execute_web_search(tool_args)+ elif node_type == 'duckduckgoSearch': return await _execute_duckduckgo_search(tool_args)+ elif node_type == 'braveSearch': return await _execute_brave_search_tool(tool_args, config['parameters'])+ elif node_type == 'serperSearch': return await _execute_serper_search_tool(tool_args, config['parameters'])+ elif node_type == 'perplexitySearch': return await _execute_perplexity_search_tool(tool_args, config['parameters'])elif node_type == 'whatsappSend': return await _execute_whatsapp_send(tool_args)elif node_type == 'whatsappDb': return await _execute_whatsapp_db(tool_args)elif node_type == 'androidTool': return await _execute_android_toolkit(tool_args, config)diff --git a/docs-internal/ai_tool_node_creation.md b/docs-internal/ai_tool_node_creation.mdindex dc29469a..7bdd516b 100644--- a/docs-internal/ai_tool_node_creation.md+++ b/docs-internal/ai_tool_node_creation.md@@ -102,7 +102,10 @@ All tools use the same schema-based approach:|-----------|--------|---------|| `calculatorTool` | `CalculatorSchema` | `_execute_calculator()` || `currentTimeTool` | `CurrentTimeSchema` | `_execute_current_time()` |-| `webSearchTool` | `WebSearchSchema` | `_execute_web_search()` |+| `duckduckgoSearch` | `DuckDuckGoSearchSchema` | `_execute_duckduckgo_search()` |+| `braveSearch` | `BraveSearchSchema` | `handle_brave_search()` |+| `serperSearch` | `SerperSearchSchema` | `handle_serper_search()` |+| `perplexitySearch` | `PerplexitySearchSchema` | `handle_perplexity_search()` || `httpRequest` | `HttpRequestSchema` | `_execute_http_request()` || `pythonExecutor` | `PythonCodeSchema` | `_execute_python_code()` || `whatsappSend` | `WhatsAppSendSchema` | `_execute_whatsapp_send()` |@@ -132,7 +135,7 @@ All tools use the same schema-based approach:Self-contained tools with all logic in a single handler.-**Examples:** `calculatorTool`, `currentTimeTool`, `webSearchTool`+**Examples:** `calculatorTool`, `currentTimeTool`, `duckduckgoSearch`, `braveSearch`, `serperSearch`, `perplexitySearch````[Calculator Tool] ──────────────────────→ [AI Agent]@@ -233,7 +236,7 @@ export const toolNodes: Record<string, INodeTypeDescription> = {export const TOOL_NODE_TYPES = ['calculatorTool','currentTimeTool',- 'webSearchTool',+ 'duckduckgoSearch','androidTool','weatherTool' // Add new tool here];@@ -263,7 +266,7 @@ Update `server/constants.py`:AI_TOOL_TYPES: FrozenSet[str] = frozenset(['calculatorTool','currentTimeTool',- 'webSearchTool',+ 'duckduckgoSearch','androidTool','weatherTool', # Add new tool here])@@ -406,8 +409,8 @@ async def execute_tool(return await _execute_calculator(llm_params)elif tool_type == 'currentTimeTool':return await _execute_current_time(llm_params)- elif tool_type == 'webSearchTool':- return await _execute_web_search(llm_params, tool_params)+ elif tool_type == 'duckduckgoSearch':+ return await _execute_duckduckgo_search(llm_params, tool_params)elif tool_type == 'httpRequest':return await _execute_http_request(llm_params, tool_params)elif tool_type == 'pythonExecutor':@@ -432,7 +435,10 @@ In `server/services/ai.py`, add the tool to `_build_tool_from_node()`:DEFAULT_TOOL_NAMES = {'calculatorTool': 'calculator','currentTimeTool': 'get_current_time',- 'webSearchTool': 'web_search',+ 'duckduckgoSearch': 'web_search',+ 'braveSearch': 'brave_search',+ 'serperSearch': 'serper_search',+ 'perplexitySearch': 'perplexity_search','androidTool': 'android_device','whatsappSend': 'whatsapp_send','whatsappDb': 'whatsapp_db',@@ -442,7 +448,10 @@ DEFAULT_TOOL_NAMES = {DEFAULT_TOOL_DESCRIPTIONS = {'calculatorTool': 'Perform mathematical calculations.','currentTimeTool': 'Get the current date and time.',- 'webSearchTool': 'Search the web for information.',+ 'duckduckgoSearch': 'Search the web using DuckDuckGo (free, no API key).',+ 'braveSearch': 'Search the web using Brave Search.',+ 'serperSearch': 'Search the web using Google via Serper API.',+ 'perplexitySearch': 'Search the web using Perplexity Sonar AI with citations.','androidTool': 'Control Android device.','whatsappSend': 'Send WhatsApp messages.','whatsappDb': 'Query WhatsApp database.',diff --git a/docs-internal/dual_purpose_tool_node_creation.md b/docs-internal/dual_purpose_tool_node_creation.mdindex ffcb26a2..96b29fbf 100644--- a/docs-internal/dual_purpose_tool_node_creation.md+++ b/docs-internal/dual_purpose_tool_node_creation.md@@ -81,7 +81,7 @@ Nodes that ONLY work as AI tools, not as workflow nodes.- Added to `AI_TOOL_TYPES` constant- Excluded from workflow execution via `CONFIG_NODE_TYPES`-**Examples:** `calculatorTool`, `currentTimeTool`, `webSearchTool`+**Examples:** `calculatorTool`, `currentTimeTool`, `duckduckgoSearch`### Dual-Purpose Tool Nodes (Active)@@ -94,7 +94,7 @@ Nodes that work BOTH as workflow nodes AND as AI tools.- NOT in `AI_TOOL_TYPES` (would break workflow execution)- Dynamically excluded when connected to `input-tools` handle-**Examples:** `whatsappSend`, `whatsappDb`, `twitterSend`, `twitterSearch`, `twitterUser`, `httpRequest`, `pythonExecutor`, `javascriptExecutor`, `addLocations`, `showNearbyPlaces`+**Examples:** `whatsappSend`, `whatsappDb`, `twitterSend`, `twitterSearch`, `twitterUser`, `httpRequest`, `pythonExecutor`, `javascriptExecutor`, `addLocations`, `showNearbyPlaces`, `braveSearch`, `serperSearch`, `perplexitySearch`### Comparison Tablediff --git a/docs-internal/node_creation.md b/docs-internal/node_creation.mdindex 71ae82f7..1a8f56d9 100644--- a/docs-internal/node_creation.md+++ b/docs-internal/node_creation.md@@ -26,7 +26,7 @@ This guide explains how to create new nodes for MachinaOs, covering frontend def## Node Types Overview-MachinaOs supports 105 nodes across 17 categories:+MachinaOs supports 108 nodes across 18 categories:| Category | Visual Component | Example Nodes | Count ||----------|-----------------|---------------|-------|@@ -37,7 +37,8 @@ MachinaOs supports 105 nodes across 17 categories:| **Specialized Agents** | AIAgentNode | android_agent, coding_agent, web_agent, task_agent, social_agent, travel_agent, tool_agent, productivity_agent, payments_agent, consumer_agent, autonomous_agent, orchestrator_agent | 12 || **AI Memory** | SquareNode | simpleMemory | 1 || **AI Skills** | SquareNode | masterSkill, customSkill + 9 individual skills | 11 |-| **AI Tools** | SquareNode | calculatorTool, currentTimeTool, webSearchTool, androidTool | 4 |+| **AI Tools** | SquareNode | calculatorTool, currentTimeTool, duckduckgoSearch, androidTool | 4 |+| **Search** | SquareNode | braveSearch, serperSearch, perplexitySearch | 3 || **Triggers** | TriggerNode | whatsappReceive, webhookTrigger, chatTrigger, twitterReceive | 4 || **Android** | SquareNode | batteryMonitor, wifiAutomation, location, cameraControl (16 services) | 16 || **WhatsApp** | SquareNode | whatsappSend, whatsappReceive, whatsappDb | 3 |@@ -1357,8 +1358,11 @@ Tool Node (calculatorTool) → (tool output) → AI Agent (input-tools handle)|------|------|-------------|| `calculatorTool` | `🔢` | Mathematical operations (add, subtract, multiply, divide, power, sqrt, mod, abs) || `currentTimeTool` | `🕐` | Get current date/time with timezone support |-| `webSearchTool` | `🔍` | Web search via DuckDuckGo (free) or Serper API |+| `duckduckgoSearch` | SVG | DuckDuckGo web search - free, no API key required || `androidTool` | `📱` | Android device control toolkit - aggregates connected Android service nodes |+| `braveSearch` | SVG | Brave Search API - web results with titles, snippets, URLs (dual-purpose) |+| `serperSearch` | SVG | Google SERP via Serper API - web, news, images, places (dual-purpose) |+| `perplexitySearch` | SVG | Perplexity Sonar AI - markdown answer with citations (dual-purpose) |### Define a Tool Node@@ -1412,7 +1416,9 @@ export const toolNodes: Record<string, INodeTypeDescription> = {};// Add to TOOL_NODE_TYPES for identification-export const TOOL_NODE_TYPES = ['calculatorTool', 'currentTimeTool', 'webSearchTool', 'androidTool', 'myCustomTool'];+export const TOOL_NODE_TYPES = ['calculatorTool', 'currentTimeTool', 'duckduckgoSearch', 'androidTool', 'myCustomTool'];+// Search nodes are in a separate file: searchNodes.ts+export const SEARCH_NODE_TYPES = ['braveSearch', 'serperSearch', 'perplexitySearch'];```### Backend: Tool Schema@@ -1432,7 +1438,7 @@ def _get_tool_schema(tool_type: str) -> type:schemas = {'calculatorTool': CalculatorSchema,'currentTimeTool': CurrentTimeSchema,- 'webSearchTool': WebSearchSchema,+ 'duckduckgoSearch': DuckDuckGoSearchSchema,'myCustomTool': MyCustomToolSchema, # Add here}return schemas.get(tool_type)@@ -1459,8 +1465,8 @@ async def execute_tool(tool_type: str, tool_params: Dict, llm_params: Dict) -> sreturn await _execute_calculator(llm_params)elif tool_type == 'currentTimeTool':return await _execute_current_time(llm_params)- elif tool_type == 'webSearchTool':- return await _execute_web_search(llm_params, tool_params)+ elif tool_type == 'duckduckgoSearch':+ return await _execute_duckduckgo_search(llm_params, tool_params)elif tool_type == 'myCustomTool':return await _execute_my_custom_tool(llm_params) # Add hereelse:diff --git a/docs-internal/pricing_service.md b/docs-internal/pricing_service.mdindex 5a96cf8a..44e3cebe 100644--- a/docs-internal/pricing_service.md+++ b/docs-internal/pricing_service.md@@ -5,7 +5,7 @@The pricing service provides centralized cost tracking for both LLM tokens and external API services (Twitter/X, Google Maps). It supports:- **LLM Token Costs**: Per-model pricing with input/output/cache/reasoning token breakdown-- **API Service Costs**: Per-request/resource pricing for third-party APIs+- **API Service Costs**: Per-request/resource pricing for third-party APIs (Twitter/X, Google Maps, Search APIs)- **Automatic Tracking**: HTTPX event hooks for transparent API call tracking- **Manual Tracking**: Helper functions for services that don't use HTTPX@@ -92,6 +92,22 @@ Located at `server/config/pricing.json`. User-editable with hot-reload support."posts_read": 0.005,"content_create": 0.010,"user_read": 0.010+ },+ "brave_search": {+ "_description": "Brave Search API pricing (per query)",+ "web_search": 0.003,+ "_default": 0.003+ },+ "serper": {+ "_description": "Serper Google Search API pricing (per query)",+ "web_search": 0.001,+ "_default": 0.001+ },+ "perplexity": {+ "_description": "Perplexity Sonar API pricing (per request)",+ "sonar_search": 0.005,+ "sonar_pro_search": 0.005,+ "_default": 0.005}},@@ -103,6 +119,15 @@ Located at `server/config/pricing.json`. User-editable with hot-reload support."twitter": {"tweet": "content_create","search": "posts_read"+ },+ "brave_search": {+ "web_search": "web_search"+ },+ "serper": {+ "web_search": "web_search"+ },+ "perplexity": {+ "sonar_search": "sonar_search"}},@@ -243,6 +268,23 @@ async def _track_twitter_usage(node_id, action, resource_count=1, workflow_id=Noawait _track_twitter_usage(node_id, 'tweet', 1, workflow_id, session_id)```+### Example: Search Handler++```python+# server/services/handlers/search.py++async def _track_search_usage(node_id, service, action, resource_count=1, workflow_id=None, session_id="default"):+ # Same pattern as maps/twitter+ pricing = get_pricing_service()+ cost_data = pricing.calculate_api_cost(service, action, resource_count)+ # ... save to database ...++# Usage in each handler:+await _track_search_usage(node_id, 'brave_search', 'web_search', 1, workflow_id, session_id)+await _track_search_usage(node_id, 'serper', 'web_search', 1, workflow_id, session_id)+await _track_search_usage(node_id, 'perplexity', 'sonar_search', 1, workflow_id, session_id)+```+## Automatic HTTPX TrackingFor services using `httpx.AsyncClient`, use the tracked client for transparent tracking.@@ -457,6 +499,7 @@ await _track_new_service_usage(node_id, 'get_data', len(results), workflow_id)| `server/services/tracked_http.py` | HTTPX event hooks for automatic tracking || `server/services/maps.py` | Manual tracking example (`_track_maps_usage`) || `server/services/handlers/twitter.py` | Manual tracking example (`_track_twitter_usage`) |+| `server/services/handlers/search.py` | Manual tracking example (`_track_search_usage`) || `server/models/database.py` | `APIUsageMetric`, `TokenUsageMetric` models || `server/core/database.py` | `save_api_usage_metric()`, `get_api_usage_summary()` || `client/src/components/CredentialsModal.tsx` | `renderApiUsagePanel()` UI component |diff --git a/docs-internal/workflow-schema.md b/docs-internal/workflow-schema.mdindex c547c473..9e46abb4 100644--- a/docs-internal/workflow-schema.md+++ b/docs-internal/workflow-schema.md@@ -97,9 +97,15 @@ Connect to Chat Agent's `input-skill` handle:Connect to AI Agent's `input-tools` handle:- `calculatorTool` - Mathematical operations- `currentTimeTool` - Current date/time with timezone-- `webSearchTool` - Web search (DuckDuckGo, Serper, Google)+- `duckduckgoSearch` - DuckDuckGo web search (free, no API key)- `androidTool` - Android toolkit aggregator (sub-node pattern)+### Search Nodes (3 nodes)+Dual-purpose nodes (workflow + AI tool). Defined in `searchNodes.ts`:+- `braveSearch` - Brave Search API web results+- `serperSearch` - Google SERP via Serper API (web, news, images, places)+- `perplexitySearch` - Perplexity Sonar AI-powered search with markdown answer and citations+### Location Nodes (3 nodes)- `createMap` - Google Maps creation with center, zoom, map type- `addLocations` - Google Maps Geocoding (address to coordinates)diff --git a/import.json b/import.jsonindex 5d0f3a61..4a5470f6 100644--- a/import.json+++ b/import.json@@ -3,14 +3,14 @@"name": "Test","nodes": [{- "id": "assistantPersonality-1769755203568",- "type": "assistantPersonality",+ "id": "masterSkill-1769755203568",+ "type": "masterSkill","position": {"x": 1800,"y": 180},"data": {- "label": "Assistant Personality"+ "label": "Master Skill"},"width": 112,"height": 82,@@ -41,14 +41,14 @@"dragging": true},{- "id": "webSearchTool-1769755286327",- "type": "webSearchTool",+ "id": "duckduckgoSearch-1769755286327",+ "type": "duckduckgoSearch","position": {"x": 1840,"y": 880},"data": {- "label": "Web Search Tool"+ "label": "DuckDuckGo"},"width": 91,"height": 82,@@ -842,11 +842,11 @@"stroke": "#8be9fd","strokeWidth": 3},- "source": "assistantPersonality-1769755203568",+ "source": "masterSkill-1769755203568","sourceHandle": "output-main","target": "chatAgent-1770060581808","targetHandle": "input-skill",- "id": "reactflow__edge-assistantPersonality-1769755203568output-main-chatAgent-1770060581808input-skill",+ "id": "reactflow__edge-masterSkill-1769755203568output-main-chatAgent-1770060581808input-skill","selected": false},{@@ -1038,11 +1038,11 @@"stroke": "#8be9fd","strokeWidth": 3},- "source": "webSearchTool-1769755286327",+ "source": "duckduckgoSearch-1769755286327","sourceHandle": "output-tool","target": "web_agent-1770070863433","targetHandle": "input-tools",- "id": "reactflow__edge-webSearchTool-1769755286327output-tool-web_agent-1770070863433input-tools",+ "id": "reactflow__edge-duckduckgoSearch-1769755286327output-tool-web_agent-1770070863433input-tools","selected": false},{diff --git a/server/constants.py b/server/constants.pyindex b3a71063..9c529940 100644--- a/server/constants.py+++ b/server/constants.py@@ -45,7 +45,7 @@ AI_MEMORY_TYPES: FrozenSet[str] = frozenset([AI_TOOL_TYPES: FrozenSet[str] = frozenset(['calculatorTool','currentTimeTool',- 'webSearchTool',+ 'duckduckgoSearch','androidTool',])diff --git a/server/routers/websocket.py b/server/routers/websocket.pyindex 6b983c3a..38cf82d5 100644--- a/server/routers/websocket.py+++ b/server/routers/websocket.py@@ -987,7 +987,9 @@ async def handle_validate_api_key(data: Dict[str, Any], websocket: WebSocket) ->broadcaster = get_status_broadcaster()provider, api_key = data["provider"].lower(), data["api_key"].strip()- models = await ai_service.fetch_models(provider, api_key)+ # Service-only providers don't have models to fetch+ AI_PROVIDERS = {'openai', 'anthropic', 'gemini', 'openrouter', 'groq', 'cerebras'}+ models = await ai_service.fetch_models(provider, api_key) if provider in AI_PROVIDERS else []await auth_service.store_api_key(provider=provider, api_key=api_key, models=models,session_id=data.get("session_id", "default"))# Broadcast with hasKey and models so frontend can update reactivelydiff --git a/server/services/ai.py b/server/services/ai.pyindex f2f53365..3cd48184 100644--- a/server/services/ai.py+++ b/server/services/ai.py@@ -1951,7 +1951,7 @@ class AIService:logger.debug(f"[ChatAgent] Enhanced system message with {len(skill_names)} skill contexts")# Build tools from tool_data using same method as AI Agent- # This supports ALL tool types: calculatorTool, currentTimeTool, webSearchTool, androidTool, httpRequest+ # This supports ALL tool types: calculatorTool, currentTimeTool, duckduckgoSearch, androidTool, httpRequestall_tools = []tool_node_configs = {} # Map tool name to node config (same as AI Agent's tool_configs)if tool_data:@@ -2357,7 +2357,7 @@ class AIService:DEFAULT_TOOL_NAMES = {'calculatorTool': 'calculator','currentTimeTool': 'get_current_time',- 'webSearchTool': 'web_search',+ 'duckduckgoSearch': 'web_search','pythonExecutor': 'python_code','javascriptExecutor': 'javascript_code','androidTool': 'android_device',@@ -2409,7 +2409,7 @@ class AIService:DEFAULT_TOOL_DESCRIPTIONS = {'calculatorTool': 'Perform mathematical calculations. Operations: add, subtract, multiply, divide, power, sqrt, mod, abs','currentTimeTool': 'Get the current date and time. Optionally specify timezone.',- 'webSearchTool': 'Search the web for information. Returns relevant search results.',+ 'duckduckgoSearch': 'Search the web for information using DuckDuckGo. Returns relevant search results. Free, no API key required.','pythonExecutor': 'Execute Python code for calculations, data processing, and automation. Available: math, json, datetime, Counter, defaultdict. Set output variable with result.','javascriptExecutor': 'Execute JavaScript code for calculations, data processing, and JSON manipulation. Set output variable with result.','androidTool': 'Control Android device. Available services are determined by connected nodes.',@@ -2635,13 +2635,13 @@ class AIService:return CurrentTimeSchema- # Web search tool schema- if node_type == 'webSearchTool':- class WebSearchSchema(BaseModel):- """Schema for web search tool arguments."""+ # DuckDuckGo search tool schema+ if node_type == 'duckduckgoSearch':+ class DuckDuckGoSearchSchema(BaseModel):+ """Search the web using DuckDuckGo (free, no API key)."""query: str = Field(description="Search query to look up on the web")- return WebSearchSchema+ return DuckDuckGoSearchSchema# Brave Search tool schema (dual-purpose: workflow node + AI tool)if node_type == 'braveSearch':diff --git a/server/services/handlers/tools.py b/server/services/handlers/tools.pyindex 5a87667f..8615e5d4 100644--- a/server/services/handlers/tools.py+++ b/server/services/handlers/tools.py@@ -71,9 +71,9 @@ async def execute_tool(tool_name: str, tool_args: Dict[str, Any],if node_type == 'currentTimeTool':return await _execute_current_time(tool_args, config.get('parameters', {}))- # Web search tool- if node_type == 'webSearchTool':- return await _execute_web_search(tool_args, config.get('parameters', {}))+ # DuckDuckGo search tool (free, no API key)+ if node_type == 'duckduckgoSearch':+ return await _execute_duckduckgo_search(tool_args, config.get('parameters', {}))# Timer tool (dual-purpose: workflow node + AI tool)# LLM fills duration/unit via Pydantic schema; calls existing handle_timer handler@@ -563,7 +563,7 @@ async def _execute_current_time(args: Dict[str, Any],return {"error": f"Invalid timezone: {timezone_str}. Error: {str(e)}"}-async def _execute_web_search(args: Dict[str, Any],+async def _execute_duckduckgo_search(args: Dict[str, Any],node_params: Dict[str, Any]) -> Dict[str, Any]:"""Execute web search.diff --git a/server/services/temporal/workflow.py b/server/services/temporal/workflow.pyindex 3f4827aa..002f55da 100644--- a/server/services/temporal/workflow.py+++ b/server/services/temporal/workflow.py@@ -30,8 +30,7 @@ ANDROID_SERVICE_TYPES = {# Skill node types (connect to Zeenie's input-skill, not executed directly)SKILL_NODE_TYPES = {- "assistantPersonality", "whatsappSkill", "memorySkill", "mapsSkill",- "httpSkill", "schedulerSkill", "androidSkill", "codeSkill", "customSkill",+ "masterSkill",}@workflow.defn(sandboxed=False)diff --git a/server/skills/web_agent/brave-search-skill/SKILL.md b/server/skills/web_agent/brave-search-skill/SKILL.mdnew file mode 100644index 00000000..de4b027d--- /dev/null+++ b/server/skills/web_agent/brave-search-skill/SKILL.md@@ -0,0 +1,114 @@+---+name: brave-search-skill+description: Search the web using Brave Search API for privacy-focused, independent search results with no tracking.+allowed-tools: brave_search+metadata:+ author: machina+ version: "1.0"+ category: search+ icon: "🦁"+ color: "#FB542B"+---++# Brave Search Skill++Search the web using the Brave Search API. Brave Search is a privacy-focused, independent search engine that does not track users or profile them.++## How It Works++This skill provides instructions and context. To execute searches, connect the **Brave Search** node to the agent's `input-tools` handle.++## brave_search Tool++Search the web and get relevant results from Brave's independent index.++### Schema Fields++| Field | Type | Required | Description |+|-------|------|----------|-------------|+| query | string | Yes | Search query to look up on the web |++### Node Parameters++Additional options configured on the node:++| Parameter | Default | Description |+|-----------|---------|-------------|+| maxResults | 10 | Number of results to return (max 100) |+| country | (empty) | Country code for regional results (e.g., US, GB, DE) |+| searchLang | (empty) | Language code for search results (e.g., en, es, fr) |+| safeSearch | moderate | Safe search filtering: off, moderate, strict |++### Response Format++```json+{+ "query": "artificial intelligence news",+ "results": [+ {+ "title": "AI Breakthrough in Medical Research",+ "snippet": "Researchers have developed a new AI model that can predict...",+ "url": "https://example.com/ai-medical-research"+ }+ ],+ "result_count": 10,+ "provider": "brave_search"+}+```++### Examples++**General search:**+```json+{+ "query": "latest news about artificial intelligence"+}+```++**Technical search:**+```json+{+ "query": "Python asyncio best practices 2026"+}+```++**Local search:**+```json+{+ "query": "best restaurants in San Francisco"+}+```++## When to Use Brave Search++- **Privacy-focused results** - No user tracking or profiling+- **Independent index** - Not reliant on Google or Bing+- **General web search** - News, facts, documentation, products+- **Regional results** - Use country/language parameters for localized results++## When NOT to Use Brave Search++- **AI-powered answers** - Use Perplexity instead for synthesized answers with citations+- **Google-specific results** - Use Serper for Google's index+- **Simple calculations** - Use the calculator tool+- **Creative tasks** - Writing, brainstorming, analysis++## Search Query Best Practices++- Use specific, focused queries (under 10 words when possible)+- Include relevant keywords, dates, and context+- Break complex questions into simpler searches+- Avoid filler words like "please" or "can you tell me"++## API Details++- **API**: GET `https://api.search.brave.com/res/v1/web/search`+- **Auth**: `X-Subscription-Token` header+- **Rate Limits**: Depends on plan (Free: 1 query/sec, 2000/month)+- **Pricing**: ~$0.003 per query++## Setup Requirements++1. Connect this skill to the agent's `input-skill` handle+2. Connect the **Brave Search** node to the agent's `input-tools` handle+3. Add your Brave Search API key in Credentials > Searchdiff --git a/server/skills/web_agent/web-search-skill/SKILL.md b/server/skills/web_agent/duckduckgo-search-skill/SKILL.mdsimilarity index 65%rename from server/skills/web_agent/web-search-skill/SKILL.mdrename to server/skills/web_agent/duckduckgo-search-skill/SKILL.mdindex fc6fe4f3..0c05d006 100644--- a/server/skills/web_agent/web-search-skill/SKILL.md+++ b/server/skills/web_agent/duckduckgo-search-skill/SKILL.md@@ -1,26 +1,31 @@----name: web-search-skill-description: Search the web for current information, news, facts, and real-time data that may not be in your training data.+name: duckduckgo-search-skill+description: Search the web using DuckDuckGo for free, privacy-focused results with no API key required.allowed-tools: web_searchmetadata:author: machina- version: "1.0"+ version: "2.0"category: search- icon: "🔍"- color: "#bd93f9"+ icon: "🦆"+ color: "#DE5833"----# Web Search Skill+# DuckDuckGo Search Skill-This skill enables you to search the web for current, up-to-date information.+This skill enables free web search via DuckDuckGo. No API key required.++For premium search providers, see the dedicated skills:+- **brave-search-skill** - Brave Search API (independent index, privacy-focused)+- **serper-search-skill** - Serper API (Google-powered, news/images/places)+- **perplexity-search-skill** - Perplexity Sonar AI (synthesized answers with citations)## How It Works-This skill provides instructions and context. To execute web searches, connect the **Web Search Tool** node to the Zeenie's `input-tools` handle.+This skill provides instructions and context. To execute web searches, connect the **DuckDuckGo Search** node to the agent's `input-tools` handle.## web_search Tool-Search the web and get relevant results.+Search the web using DuckDuckGo and get relevant results.### Schema Fields@@ -28,6 +33,12 @@ Search the web and get relevant results.|-------|------|----------|-------------|| query | string | Yes | The search query to look up on the web |+### Node Parameters++| Parameter | Default | Description |+|-----------|---------|-------------|+| maxResults | 5 | Number of results to return |+### Examples**Basic search:**@@ -79,9 +90,9 @@ Search the web and get relevant results.}```-## When to Use Web Search+## When to Use DuckDuckGo Search-Use web search when the user asks about:+Use DuckDuckGo search when the user asks about:1. **Current events and news** - Recent happenings, breaking news, current affairs2. **Real-time data** - Stock prices, weather, sports scores, exchange rates@@ -91,7 +102,7 @@ Use web search when the user asks about:6. **Local information** - Business hours, addresses, phone numbers7. **Product information** - Prices, availability, reviews-## When NOT to Use Web Search+## When NOT to Use DuckDuckGo SearchAvoid searching when:@@ -101,6 +112,17 @@ Avoid searching when:4. **Personal advice** - Relationship, life decisions5. **Subjective opinions** - Preferences, recommendations without factual basis+## Choosing the Right Search Provider++| Need | Recommended Provider | Tool Node |+|------|---------------------|-----------|+| Free search, no API key | DuckDuckGo | DuckDuckGo Search |+| Google-quality results | Serper | Serper Search |+| News, images, places | Serper | Serper Search |+| Privacy-focused, independent | Brave | Brave Search |+| AI-synthesized answers | Perplexity | Perplexity Search |+| Research with citations | Perplexity | Perplexity Search |+## Search Query Best Practices### Do:@@ -119,7 +141,7 @@ Avoid searching when:| Bad Query | Good Query ||-----------|------------|| "Can you please tell me what the weather is like in London today?" | "London weather today" |-| "I want to know about the latest iPhone model and its features" | "iPhone 15 Pro specifications" |+| "I want to know about the latest iPhone model and its features" | "iPhone 16 Pro specifications" || "What is happening in the stock market right now?" | "stock market news today" |## Handling Results@@ -130,27 +152,16 @@ Avoid searching when:4. **Suggest follow-up searches** if the initial results are insufficient5. **Combine multiple searches** for comprehensive answers-## Provider Information--The Web Search Tool supports multiple providers:--| Provider | API Key Required | Notes |-|----------|-----------------|-------|-| DuckDuckGo | No | Free, privacy-focused, good general results |-| Serper API | Yes | Google-powered, high quality, requires API key |-| Google Custom Search | Yes | Direct Google results, requires setup |--The default provider (DuckDuckGo) works without any API key.-## Limitations-- Results depend on the search provider's index+- DuckDuckGo uses the `ddgs` library (free, no API key)+- Results depend on DuckDuckGo's index- Some recent events may not be indexed immediately- Paywalled content may show limited snippets- Results are in English by default## Setup Requirements-1. Connect this skill to Zeenie's `input-skill` handle-2. Connect the Web Search Tool node to Zeenie's `input-tools` handle-3. (Optional) Configure API key in the tool node for Serper or Google+1. Connect this skill to the agent's `input-skill` handle+2. Connect the **DuckDuckGo Search** node to the agent's `input-tools` handle+3. No API key required for DuckDuckGodiff --git a/server/skills/web_agent/perplexity-search-skill/SKILL.md b/server/skills/web_agent/perplexity-search-skill/SKILL.mdnew file mode 100644index 00000000..7ac63513--- /dev/null+++ b/server/skills/web_agent/perplexity-search-skill/SKILL.md@@ -0,0 +1,146 @@+---+name: perplexity-search-skill+description: Search the web using Perplexity Sonar AI for synthesized answers with citations, related questions, and optional images.+allowed-tools: perplexity_search+metadata:+ author: machina+ version: "1.0"+ category: search+ icon: "🧠"+ color: "#20808D"+---++# Perplexity Search Skill++Search the web using Perplexity's Sonar AI models. Unlike traditional search engines that return links, Perplexity provides synthesized AI-generated answers with inline citations and source URLs.++## How It Works++This skill provides instructions and context. To execute searches, connect the **Perplexity Search** node to the agent's `input-tools` handle.++## perplexity_search Tool++Ask a question and get an AI-synthesized answer with citations.++### Schema Fields++| Field | Type | Required | Description |+|-------|------|----------|-------------|+| query | string | Yes | Question or search query to get AI-powered answer with citations |++### Node Parameters++Additional options configured on the node:++| Parameter | Default | Description |+|-----------|---------|-------------|+| model | sonar | Model: sonar (fast), sonar-pro (deeper research) |+| searchRecencyFilter | (empty) | Filter results by recency: month, week, day, hour |+| returnImages | false | Include relevant images in response |+| returnRelatedQuestions | false | Include follow-up question suggestions |++### Response Format++```json+{+ "query": "What are the latest developments in quantum computing?",+ "answer": "Recent developments in quantum computing include several significant breakthroughs. **Google's Willow chip** demonstrated error correction below the threshold needed for reliable quantum computation [1]. **IBM** released its 1,121-qubit Condor processor [2], while **Microsoft** announced a new topological qubit approach [3].\n\nKey areas of progress:\n- Error correction advances\n- Increased qubit counts\n- New materials and architectures\n- Growing commercial applications",+ "citations": [+ "https://blog.google/technology/research/quantum-computing-willow/",+ "https://research.ibm.com/blog/condor-processor",+ "https://azure.microsoft.com/en-us/blog/quantum/"+ ],+ "results": [+ {"url": "https://blog.google/technology/research/quantum-computing-willow/"},+ {"url": "https://research.ibm.com/blog/condor-processor"},+ {"url": "https://azure.microsoft.com/en-us/blog/quantum/"}+ ],+ "model": "sonar",+ "provider": "perplexity",+ "images": [],+ "related_questions": [+ "What is quantum error correction?",+ "How many qubits does a useful quantum computer need?"+ ]+}+```++### Examples++**Research question:**+```json+{+ "query": "What are the latest developments in quantum computing?"+}+```++**Technical question:**+```json+{+ "query": "How does React Server Components work in Next.js 15?"+}+```++**Current events:**+```json+{+ "query": "What happened at the latest AI safety summit?"+}+```++**Comparison:**+```json+{+ "query": "Compare PostgreSQL vs MySQL for large-scale applications"+}+```++## When to Use Perplexity Search++- **Research questions** - Get synthesized, well-structured answers with citations+- **Technical explanations** - Detailed answers about how things work+- **Current events analysis** - AI-summarized coverage of recent events+- **Comparison queries** - Side-by-side analysis of options+- **Complex topics** - Multi-faceted questions that benefit from AI synthesis+- **When you need citations** - Every claim backed by source URLs++## When NOT to Use Perplexity Search++- **Simple factual lookups** - Use Brave or Serper for quick facts+- **Image search** - Use Serper with searchType "images"+- **Local business search** - Use Serper with searchType "places"+- **High-volume queries** - Perplexity costs more per query ($0.005)+- **Simple calculations** - Use the calculator tool++## Key Differences from Traditional Search++| Aspect | Traditional Search (Brave/Serper) | Perplexity Sonar |+|--------|----------------------------------|-----------------|+| Output | List of links with snippets | AI-written answer with inline citations |+| Format | title + snippet + URL | Full markdown answer with [1][2] references |+| Best for | Quick lookups, browsing | Research, explanations, synthesis |+| Speed | Faster | Slightly slower (AI generation) |+| Cost | $0.001-0.003/query | $0.005/query |++## Answer Format++The `answer` field contains rich markdown:+- **Bold text** for emphasis+- Numbered citations [1][2] referencing the `citations` array+- Bullet points and lists for structured information+- Headers for organized sections+- Code blocks for technical content++## API Details++- **API**: POST `https://api.perplexity.ai/chat/completions`+- **Auth**: `Authorization: Bearer` header+- **Models**: `sonar` (fast, default), `sonar-pro` (deeper research)+- **Timeout**: 60 seconds (AI generation takes longer than traditional search)+- **Pricing**: ~$0.005 per request++## Setup Requirements++1. Connect this skill to the agent's `input-skill` handle+2. Connect the **Perplexity Search** node to the agent's `input-tools` handle+3. Add your Perplexity API key in Credentials > Searchdiff --git a/server/skills/web_agent/serper-search-skill/SKILL.md b/server/skills/web_agent/serper-search-skill/SKILL.mdnew file mode 100644index 00000000..56f45951--- /dev/null+++ b/server/skills/web_agent/serper-search-skill/SKILL.md@@ -0,0 +1,172 @@+---+name: serper-search-skill+description: Search the web using Serper API for Google-powered search results including web, news, images, and places.+allowed-tools: serper_search+metadata:+ author: machina+ version: "1.0"+ category: search+ icon: "🔎"+ color: "#4285F4"+---++# Serper Search Skill++Search the web using the Serper API, which provides Google Search results via a simple API. Supports web search, news, images, and places.++## How It Works++This skill provides instructions and context. To execute searches, connect the **Serper Search** node to the agent's `input-tools` handle.++## serper_search Tool++Search Google via Serper API and get structured results.++### Schema Fields++| Field | Type | Required | Description |+|-------|------|----------|-------------|+| query | string | Yes | Search query to look up on Google |++### Node Parameters++Additional options configured on the node:++| Parameter | Default | Description |+|-----------|---------|-------------|+| maxResults | 10 | Number of results to return (max 100) |+| searchType | search | Type: search (web), news, images, places |+| country | (empty) | Country code for regional results (gl parameter) |+| language | (empty) | Language code for results (hl parameter) |++### Response Format++**Web search:**+```json+{+ "query": "artificial intelligence news",+ "results": [+ {+ "title": "AI Breakthrough in Medical Research",+ "snippet": "Researchers have developed a new AI model...",+ "url": "https://example.com/ai-research",+ "position": 1+ }+ ],+ "result_count": 10,+ "search_type": "search",+ "provider": "serper",+ "knowledge_graph": {+ "title": "Artificial Intelligence",+ "description": "..."+ }+}+```++**News search:**+```json+{+ "query": "technology news today",+ "results": [+ {+ "title": "Tech Industry Update",+ "snippet": "Major developments in...",+ "url": "https://example.com/news",+ "date": "2 hours ago",+ "source": "TechCrunch"+ }+ ],+ "search_type": "news",+ "provider": "serper"+}+```++**Images search:**+```json+{+ "query": "aurora borealis photos",+ "results": [+ {+ "title": "Northern Lights Over Iceland",+ "imageUrl": "https://example.com/image.jpg",+ "url": "https://example.com/gallery"+ }+ ],+ "search_type": "images",+ "provider": "serper"+}+```++**Places search:**+```json+{+ "query": "coffee shops near me",+ "results": [+ {+ "title": "Blue Bottle Coffee",+ "address": "123 Main St, San Francisco, CA",+ "rating": 4.5,+ "url": "https://bluebottlecoffee.com"+ }+ ],+ "search_type": "places",+ "provider": "serper"+}+```++### Examples++**Web search:**+```json+{+ "query": "Python 3.13 new features"+}+```++**News search** (set searchType to "news" on node):+```json+{+ "query": "stock market today"+}+```++**Places search** (set searchType to "places" on node):+```json+{+ "query": "Italian restaurants in Manhattan"+}+```++## When to Use Serper Search++- **Google-quality results** - Powered by Google's search index+- **News search** - Set searchType to "news" for current headlines with sources and dates+- **Image search** - Set searchType to "images" for visual content+- **Places/Local search** - Set searchType to "places" for business listings with ratings+- **Knowledge Graph** - Includes Google Knowledge Graph data when available++## When NOT to Use Serper Search++- **AI-powered answers** - Use Perplexity instead for synthesized answers+- **Privacy-focused search** - Use Brave Search instead+- **Simple calculations** - Use the calculator tool+- **Creative tasks** - Writing, brainstorming, analysis++## Search Query Best Practices++- Use specific, focused queries (under 10 words when possible)+- Include relevant keywords, dates, and context+- Use Google search operators: `site:`, `filetype:`, `intitle:`, `-exclude`+- Break complex questions into simpler searches++## API Details++- **API**: POST `https://google.serper.dev/search` (also /news, /images, /places)+- **Auth**: `X-API-KEY` header+- **Pricing**: ~$0.001 per query (one of the cheapest Google SERP APIs)++## Setup Requirements++1. Connect this skill to the agent's `input-skill` handle+2. Connect the **Serper Search** node to the agent's `input-tools` handle+3. Add your Serper API key in Credentials > Scrapersdiff --git a/workflows/Zeenie_Agent.json b/workflows/Zeenie_Agent.jsonindex 14975f3a..749c3918 100644--- a/workflows/Zeenie_Agent.json+++ b/workflows/Zeenie_Agent.json@@ -98,14 +98,14 @@"dragging": true},{- "id": "webSearchTool-1770207714722",- "type": "webSearchTool",+ "id": "duckduckgoSearch-1770207714722",+ "type": "duckduckgoSearch","position": {"x": 640,"y": 540},"data": {- "label": "Web Search Tool"+ "label": "DuckDuckGo"},"width": 91,"height": 82,@@ -342,11 +342,11 @@"stroke": "#8be9fd","strokeWidth": 3},- "source": "webSearchTool-1770207714722",+ "source": "duckduckgoSearch-1770207714722","sourceHandle": "output-tool","target": "chatAgent-1770207244010","targetHandle": "input-tools",- "id": "reactflow__edge-webSearchTool-1770207714722output-tool-chatAgent-1770207244010input-tools",+ "id": "reactflow__edge-duckduckgoSearch-1770207714722output-tool-chatAgent-1770207244010input-tools","selected": false},{diff --git a/workflows/Zeenie_Assistant.json b/workflows/Zeenie_Assistant.jsonindex ae85e8f5..c7ed3092 100644--- a/workflows/Zeenie_Assistant.json+++ b/workflows/Zeenie_Assistant.json@@ -22,14 +22,14 @@"dragging": false},{- "id": "webSearchTool-1769755286327",- "type": "webSearchTool",+ "id": "duckduckgoSearch-1769755286327",+ "type": "duckduckgoSearch","position": {"x": 2100,"y": 880},"data": {- "label": "Web Search Tool"+ "label": "DuckDuckGo"},"width": 91,"height": 82,@@ -818,11 +818,11 @@"stroke": "#8be9fd","strokeWidth": 3},- "source": "webSearchTool-1769755286327",+ "source": "duckduckgoSearch-1769755286327","sourceHandle": "output-tool","target": "web_agent-1770070863433","targetHandle": "input-tools",- "id": "reactflow__edge-webSearchTool-1769755286327output-tool-web_agent-1770070863433input-tools",+ "id": "reactflow__edge-duckduckgoSearch-1769755286327output-tool-web_agent-1770070863433input-tools","selected": false},{