diff --git a/apps/rowboat/app/lib/prebuilt-cards/twitter-sentiment.json b/apps/rowboat/app/lib/prebuilt-cards/twitter-sentiment.json index 03f78daa..51d6fb76 100644 --- a/apps/rowboat/app/lib/prebuilt-cards/twitter-sentiment.json +++ b/apps/rowboat/app/lib/prebuilt-cards/twitter-sentiment.json @@ -5,7 +5,7 @@ "type": "pipeline", "description": "Searches Twitter for tweets about a specified keywords.", "disabled": false, - "instructions": "## πŸ§‘β€πŸ’Ό Role:\nSearch Twitter for tweets about a given keyword within a specified time window.\n\n---\n## βš™οΈ Steps to Follow:\n1. Receive the keywords, `start_time`, and `end_time` from the parent agent.\n2. Use the [@tool:Search full archive of tweets](#mention) tool with each keyword as the query, and the provided `start_time` and `end_time`.\n3. Return the text of the tweets to the next agent in the pipeline.\n\n---\n## 🎯 Scope:\nβœ… In Scope:\n- Searching Twitter for tweets within a given time period.\n\n❌ Out of Scope:\n- Analyzing sentiment.\n- Interacting with the user directly.\n\n---\n## πŸ“‹ Guidelines:\nβœ”οΈ Dos:\n- Return only the tweet text.\n- Ensure `start_time` and `end_time` are correctly passed to the tool.\n\n🚫 Don'ts:\n- Do not perform sentiment analysis.\n- Do not interact with the user directly.", + "instructions": "## πŸ§‘β€πŸ’Ό Role:\nSearch Twitter for tweets about a given keyword within a specified time window.\n\n---\n## βš™οΈ Steps to Follow:\n1. Receive the keywords. Use [@variable:ResultCount](#mention) for the Twitter search and [@variable:LookbackInHours](#mention) to search Twitter.\n2. Use the [@tool:Search full archive of tweets](#mention) tool with each keyword as the query, and the provided `start_time` and `end_time`.\n3. Return the text of the tweets to the next agent in the pipeline.\n\n---\n## 🎯 Scope:\nβœ… In Scope:\n- Searching Twitter for tweets within a given time period.\n\n❌ Out of Scope:\n- Analyzing sentiment.\n- Interacting with the user directly.\n\n---\n## πŸ“‹ Guidelines:\nβœ”οΈ Dos:\n- Return only the tweet text.\n- Ensure `start_time` and `end_time` are correctly passed to the tool.\n\n🚫 Don'ts:\n- Do not perform sentiment analysis.\n- Do not interact with the user directly.", "model": "google/gemini-2.5-flash", "locked": false, "toggleAble": true, diff --git a/apps/rowboat/app/projects/[projectId]/workflow/entity_list.tsx b/apps/rowboat/app/projects/[projectId]/workflow/entity_list.tsx index 27e7f02e..c8538636 100644 --- a/apps/rowboat/app/projects/[projectId]/workflow/entity_list.tsx +++ b/apps/rowboat/app/projects/[projectId]/workflow/entity_list.tsx @@ -565,7 +565,7 @@ export const EntityList = forwardRef< agents: true, tools: true, data: true, - prompts: false + prompts: true }); // Default sizes when panels are expanded diff --git a/apps/rowboat/src/application/lib/copilot/copilot_multi_agent.ts b/apps/rowboat/src/application/lib/copilot/copilot_multi_agent.ts index aecaa2e4..c3b9d196 100644 --- a/apps/rowboat/src/application/lib/copilot/copilot_multi_agent.ts +++ b/apps/rowboat/src/application/lib/copilot/copilot_multi_agent.ts @@ -54,6 +54,7 @@ Agents fall into two main types: 1. Conversational Agents (user_facing) - These agents can interact with users. - The start agent is almost always a conversational agent, called the Hub Agent. It orchestrates the overall workflow and directs task execution. +- If different agents handle completely different tasks that involve information from the user, you should make them conversational agents. - In simpler use cases, a single Hub Agent with attached tools may be enough β€” a full multi-agent setup is not always necessary. - Core responsibilities: - Break down the user's query into subtasks diff --git a/apps/rowboat/src/application/lib/copilot/example_multi_agent_1.ts b/apps/rowboat/src/application/lib/copilot/example_multi_agent_1.ts index 14401ffe..32952654 100644 --- a/apps/rowboat/src/application/lib/copilot/example_multi_agent_1.ts +++ b/apps/rowboat/src/application/lib/copilot/example_multi_agent_1.ts @@ -1102,4 +1102,184 @@ Yes, I can delete the Meeting Prep Pipeline. --- +### Example 8: Delivery Status & Product Information Assistant + +**User Request:** +Build an assistant to handle delivery status and product information questions. I'll connect my MCP for delivery status and will add data on product information. + +**Copilot Response:** + +I'll design a multi-agent system to handle both delivery status and product information questions. Here’s my plan: +Plan & Agent Decomposition: +1. Delivery Status Mocked Tool: A mocked tool to simulate checking delivery status. +2. Hub Agent (user-facing): Orchestrates the workflow, determines if the user’s question is about delivery status or product information, and routes the query accordingly. +3. Delivery Status Agent (internal): Handles delivery status queries using the mocked tool (you can connect a real MCP tool for this later). +4. Product Info Agent (internal): Handles product information queries using the RAG data source (to be added by you). + +Next Steps: +- I’ll create the agents and set the Hub Agent as the start agent. +- Once you connect your MCP tool for delivery status and add your product info data source, I can help you attach them to the relevant agents. + +--- + +### 1. Add Required Tools + +I'll add a mocked tool for getting delivery status. You can connect a real MCP server for this later: + +\`\`\`copilot_change +// action: create_new +// config_type: tool +// name: Find event +{ + "change_description": "Added mock delivery status tool for simulating delivery status checks.", + "config_changes": { + "name": "Mock Delivery Status", + "description": "A mock tool to simulate checking delivery status.", + "mockTool": true, + "mockInstructions": "This tool simulates checking the delivery status of an order. It will always return a predefined delivery status message.", + "parameters": { + "type": "object", + "properties": { + "order_id": { + "type": "string", + "description": "The order ID to check the delivery status for." + } + }, + "required": [ + "order_id" + ] + } + } +} +\`\`\` + +--- + +### 2. Add Variables + +I'm adding a variable for the Company name: + +\`\`\`copilot_change +// action: create_new +// config_type: prompt +// name: Find event +{ + "change_description": "Added variable for the Company name.", + "config_changes": { + "name": "Company name", + "type": "base_prompt", + "prompt": "" + } +} +\`\`\` + +I'm adding another variable for the assistant name: + +\`\`\`copilot_change +// action: create_new +// config_type: prompt +// name: Find event +{ + "change_description": "Added variable for the Assistant name.", + "config_changes": { + "name": "Assistant name", + "type": "base_prompt", + "prompt": "" + } + } +\`\`\` + +--- + +### 3. Create Agents + +#### a. Hub Agent (Meeting Assistant Hub) +I'll create the hub agent: + +\`\`\`copilot_change +// action: create_new +// config_type: agent +// name: Product & Delivery Assistant +{ + "change_description": "Created the hub agent.", + "config_changes": { + "name": "Product & Delivery Assistant", + "type": "conversation", + "description": "Hub agent to answer product information questions (using RAG) and delivery status questions.", + "instructions": "## πŸ§‘β€πŸ’Ό Role:\nYou are the hub agent responsible for orchestrating responses to product information and delivery status questions.\n\n---\n## βš™οΈ Steps to Follow:\n1. Greet the user and ask how you can help. Say something like 'Hi, I'm [@variable:Assistant name](#mention) from [@variable:Company name](#mention). How can I help you today?'\n2. Determine if the user's question is about product information or delivery status.\n3. If the question is about product information, transfer to [@agent:Product Information Agent](#mention).\n4. If the question is about delivery status, transfer to [@agent:Delivery Status Agent](#mention).\n5. If the question is neither, politely inform the user that you can only help with product information or delivery status.\n6. Return the final answer to the user.\n\n---\n## 🎯 Scope:\nβœ… In Scope:\n- Routing product information questions.\n- Routing delivery status questions.\n\n❌ Out of Scope:\n- Directly answering product or delivery questions.\n- Handling questions outside of product information or delivery status.\n\n---\n## πŸ“‹ Guidelines:\nβœ”οΈ Dos:\n- Clearly identify the type of user query.\n- Route to the correct agent.\n\n🚫 Don'ts:\n- Do not attempt to answer questions directly.\n- Do not ask for personal information unless explicitly required by a sub-agent.\n- CRITICAL: Only transfer to one agent at a time and wait for its response before proceeding.\n\n", + "model": "google/gemini-2.5-flash", + "toggleAble": true, + "ragReturnType": "chunks", + "ragK": 3, + "outputVisibility": "user_facing", + "controlType": "retain" + } +} +\`\`\` + +#### b. Product Information Agent + +I'll create an agent to handle product information questions. You can later connect you data sources to provide the knowledge: + +\`\`\`copilot_change +// action: create_new +// config_type: agent +// name: Product Information Agent + { + "change_description": "Created the product information agent.", + "config_changes": { + "name": "Product Information Agent", + "type": "conversation", + "description": "Answers product information questions using RAG data sources.", + "disabled": false, + "instructions": "## πŸ§‘β€πŸ’Ό Role:\nYou are an internal agent that answers product information questions using RAG data sources. If you receive a question that is not about product information, you must return control to the parent agent with a message indicating the question is out of your scope.\n\n---\n## βš™οΈ Steps to Follow:\n1. Receive the product information question from the parent agent.\n2. Determine if the question is about product information.\n - If yes: Use RAG search to pull information from the available data sources to answer the question.\n - If not: Return control to the parent agent with a message such as \"This question is not about product information. Returning to parent agent.\"\n3. Formulate a clear and concise answer based on the RAG results (if applicable).\n4. If question is out of scope call [@agent:Product & Delivery Assistant](#mention) \n\n---\n## 🎯 Scope:\nβœ… In Scope:\n- Answering product information questions using RAG.\n- Returning control to parent if the question is out of scope.\n\n❌ Out of Scope:\n- Handling delivery status questions.\n- Interacting directly with the user.\n\n---\n## πŸ“‹ Guidelines:\nβœ”οΈ Dos:\n- Use RAG search to find relevant information for product questions.\n- If the question is not about product information, return control to the parent agent with a clear message.\n\n🚫 Don'ts:\n- Do not answer questions outside of product information.\n- Do not interact with the user directly.\n- Do not ignore out-of-scope questions; always return to parent.\n", + "examples": "\n", + "model": "google/gemini-2.5-flash", + "locked": false, + "toggleAble": true, + "ragReturnType": "chunks", + "ragK": 3, + "outputVisibility": "user_facing", + "controlType": "retain", + "maxCallsPerParentAgent": 3 + } +} +\`\`\` + +#### c. Delivery Status Agent + +I'll create an agent to handle delivery status questions that uses a mocked tool for now. You can later connect your MCP tool to it. + +\`\`\`copilot_change +// action: create_new +// config_type: agent +// name: Delivery Status Agent + { + "change_description": "Created the delivery status agent.", + "config_changes": { + "name": "Delivery Status Agent", + "type": "conversation", + "description": "Answers delivery status questions using the Exa Answer tool.", + "disabled": false, + "instructions": "## πŸ§‘β€πŸ’Ό Role:\nYou are an internal agent that answers delivery status questions. If you receive a question that is not about delivery status, you must return control to the parent agent with a message indicating the question is out of your scope.\n\n---\n## βš™οΈ Steps to Follow:\n1. Receive the delivery status question from the parent agent.\n2. Determine if the question is about delivery status.\n - If yes: Use the [@tool:Mock Delivery Status](#mention) tool to search for delivery status information. You may need to ask the user for an order number or tracking ID if not provided.\n - If not: Return control to the parent agent with a message such as \"This question is not about delivery status. Returning to parent agent.\"\n3. Formulate a clear and concise answer based on the tool's results (if applicable).\n4. If question is out of scope call [@agent:Product & Delivery Assistant](#mention) \n---\n## 🎯 Scope:\nβœ… In Scope:\n- Answering delivery status questions using the Exa Answer tool.\n- Returning control to parent if the question is out of scope.\n\n❌ Out of Scope:\n- Handling product information questions.\n- Interacting directly with the user (except to ask for necessary information like order ID).\n\n---\n## πŸ“‹ Guidelines:\nβœ”οΈ Dos:\n- Use the Exa Answer tool to find delivery information for delivery status questions.\n- If the question is not about delivery status, return control to the parent agent with a clear message.\n- Ask for order details if needed.\n\n🚫 Don'ts:\n- Do not answer questions outside of delivery status.\n- Do not interact with the user directly unless absolutely necessary to get information for the tool.\n- Do not ignore out-of-scope questions; always return to parent.\n", + "examples": "\n", + "model": "gpt-4.1", + "locked": false, + "toggleAble": true, + "ragReturnType": "chunks", + "ragK": 3, + "outputVisibility": "user_facing", + "controlType": "retain", + "maxCallsPerParentAgent": 3 + } +} +\`\`\` + +--- + +Once you review and apply the changes, you can try out a basic chat first. I can then help you better configure each agent or adjust the workflow as needed. Would you like to customize any step or add more details? + +--- + + `; \ No newline at end of file