From 9e9dd8a1243ae82d40fae2aec39bc4463e09a123 Mon Sep 17 00:00:00 2001 From: Anish Sarkar <104695310+AnishSarkar22@users.noreply.github.com> Date: Sat, 11 Jul 2026 02:21:02 +0530 Subject: [PATCH] feat(subagent): update Instagram subagent prompts and tools --- .../subagents/builtins/instagram/description.md | 4 ++-- .../subagents/builtins/instagram/system_prompt.md | 9 +++------ .../subagents/builtins/instagram/tools/index.py | 5 ++--- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/surfsense_backend/app/agents/chat/multi_agent_chat/subagents/builtins/instagram/description.md b/surfsense_backend/app/agents/chat/multi_agent_chat/subagents/builtins/instagram/description.md index 9efedc52a..9d65defe4 100644 --- a/surfsense_backend/app/agents/chat/multi_agent_chat/subagents/builtins/instagram/description.md +++ b/surfsense_backend/app/agents/chat/multi_agent_chat/subagents/builtins/instagram/description.md @@ -1,2 +1,2 @@ -Instagram specialist: pulls structured data from Instagram — posts and reels (caption, likes, comments count, media URLs, owner, timestamp), a post's comments and replies, and profile/hashtag/place details (follower and post counts, bio, hashtag volume and top posts, place coordinates). Finds content by hashtag, profile, or place search, and compares fresh Instagram data against earlier findings in this chat. -Use whenever the task involves Instagram content or an instagram.com link. Triggers include "get this Instagram profile/post/reel", "find posts about X on Instagram", "how many followers/likes", "get the comments on this post", "what are people saying about this reel", "look up this hashtag/location", and comparisons against earlier Instagram results in this chat. Not for general web pages (use the web crawling specialist for non-Instagram URLs). +Instagram specialist: pulls structured data from public Instagram — posts and reels (caption, likes, comments count, media URLs, owner, timestamp) and profile details (follower and post counts, bio). Finds public profiles by search and compares fresh Instagram data against earlier findings in this chat. Anonymous-only: hashtag/place feeds and comment threads are login-walled and unavailable. +Use whenever the task involves public Instagram content or an instagram.com profile/post/reel link. Triggers include "get this Instagram profile/post/reel", "find the Instagram profile for X", "how many followers/likes", and comparisons against earlier Instagram results in this chat. Not for general web pages (use the web crawling specialist for non-Instagram URLs). diff --git a/surfsense_backend/app/agents/chat/multi_agent_chat/subagents/builtins/instagram/system_prompt.md b/surfsense_backend/app/agents/chat/multi_agent_chat/subagents/builtins/instagram/system_prompt.md index 7d5278afa..617a376b7 100644 --- a/surfsense_backend/app/agents/chat/multi_agent_chat/subagents/builtins/instagram/system_prompt.md +++ b/surfsense_backend/app/agents/chat/multi_agent_chat/subagents/builtins/instagram/system_prompt.md @@ -7,19 +7,16 @@ Answer the delegated question from live Instagram data gathered with your verbs, - `instagram_scrape` -- `instagram_comments` - `instagram_details` - `read_run` / `search_run` (free readers for stored scrape output) -- Known profile/post/reel/hashtag/place links: call `instagram_scrape` with the links in `urls` (use `result_type` to pick posts, reels, or mentions). -- Finding content on a topic: call `instagram_scrape` with `search_queries` and the matching `search_type` (hashtag, profile, or place). -- Comments / sentiment on specific posts or reels: call `instagram_comments` with the post `urls`. -- Profile, hashtag, or place metadata (follower counts, bio, hashtag volume, coordinates): call `instagram_details`. +- Known profile/post/reel links: call `instagram_scrape` with the links in `urls` (use `result_type` to pick posts, reels, or mentions). Hashtag/place URLs are unsupported (login-walled). +- Finding a profile on a topic: call `instagram_scrape` with `search_queries` (resolved to public profiles via Google; `search_type` is profile-only). +- Profile metadata (follower counts, bio, post count): call `instagram_details`. - Batch multiple URLs (or queries) into one call rather than many single-item calls. -- Multi-post comment analysis: a batched comments result lists posts in order, so a truncated preview usually shows only the first post(s). Before summarizing, page the stored run (or `search_run` by post id) until you have read real comments for EVERY post in the batch — never infer one post's sentiment from another's, and never report a post as "limited data" while its comments sit unread in the run. - Comparison requests: pull the current values, compare against prior values already in this conversation's earlier tool results, and report concrete deltas (added, removed, old -> new). diff --git a/surfsense_backend/app/agents/chat/multi_agent_chat/subagents/builtins/instagram/tools/index.py b/surfsense_backend/app/agents/chat/multi_agent_chat/subagents/builtins/instagram/tools/index.py index 1bfbabad9..033ec6f0c 100644 --- a/surfsense_backend/app/agents/chat/multi_agent_chat/subagents/builtins/instagram/tools/index.py +++ b/surfsense_backend/app/agents/chat/multi_agent_chat/subagents/builtins/instagram/tools/index.py @@ -1,4 +1,4 @@ -"""``instagram`` sub-agent tools: the three Instagram capability verbs.""" +"""``instagram`` sub-agent tools: the Instagram capability verbs.""" from __future__ import annotations @@ -8,7 +8,6 @@ from langchain_core.tools import BaseTool from app.agents.chat.multi_agent_chat.shared.permissions import Ruleset from app.capabilities.core.access.agent import build_capability_tools -from app.capabilities.instagram.comments.definition import INSTAGRAM_COMMENTS from app.capabilities.instagram.details.definition import INSTAGRAM_DETAILS from app.capabilities.instagram.scrape.definition import INSTAGRAM_SCRAPE @@ -16,7 +15,7 @@ NAME = "instagram" RULESET = Ruleset(origin=NAME, rules=[]) -_CI_VERBS = [INSTAGRAM_SCRAPE, INSTAGRAM_COMMENTS, INSTAGRAM_DETAILS] +_CI_VERBS = [INSTAGRAM_SCRAPE, INSTAGRAM_DETAILS] def load_tools(