### Tip: Use Examples in Instructions Source: https://docs.agent.ai/knowledge-agents/configuration Demonstrates how to use examples within system instructions to guide the agent's output formatting, showing a good example. ```markdown Good: "When presenting research, format like this: ## Key Findings - Finding 1 - Finding 2 ``` -------------------------------- ### Add Sample Questions Source: https://docs.agent.ai/knowledge-agents/quickstart Provide example queries that users can click to quickly start interacting with the agent. These suggestions appear on the initial user interface. ```text Research the latest trends in AI automation Find information about sustainable energy companies Analyze the competitive landscape for SaaS tools Summarize key insights from recent tech news ``` -------------------------------- ### Setting Expectations: Example Interactions Source: https://docs.agent.ai/knowledge-agents/conversations Demonstrates how to include example prompts within a welcome message to guide users on how to interact with the agent. ```text Include in your welcome message: "Try asking me: - 'Research TechCorp and its competitors' - 'Find 10 AI startups in San Francisco' - 'Enrich this list with funding data'" ``` -------------------------------- ### Effective Prompt Hints Examples Source: https://docs.agent.ai/knowledge-agents/configuration Provides specific examples of prompt hints for different agent types to guide user input. ```text Research Assistant: "Ask me to research a company or topic..." Marketing Assistant: "What campaign are you working on?" Development Assistant: "Ask me to run tests, create a PR, or explain our architecture..." Sales Assistant: "Enter a company name to research..." Content Creator: "What content do you need help creating?" Data Analyst: "Ask me to analyze data or generate a report..." ``` -------------------------------- ### Slack Integration Example Source: https://docs.agent.ai/knowledge-agents/tools-integration Demonstrates how an agent can use a Slack integration to send messages after confirming details with the user. Requires system instructions to guide the agent's behavior. ```System Instructions You are a team communication assistant with access to Slack. When users ask you to notify the team or send a message: 1. Ask which channel (if they didn't specify) 2. Confirm the message content 3. Use the Slack integration to send the message 4. Confirm it was sent Always get approval before sending messages to public channels. ``` -------------------------------- ### Teaching and Examples Example Source: https://docs.agent.ai/knowledge-agents/conversations An example of using shared conversations to create tutorials and demonstrate effective agent usage. ```text Create example conversations showing: - How to use the agent effectively - What kinds of questions to ask - Sample workflows end-to-end Share these as tutorials. ``` -------------------------------- ### Integrate with Agent.ai MCP Server using SDK Source: https://docs.agent.ai/mcp-server Example of how to initialize an MCP client, connect to the server using OAuth, list available tools, and call a tool. Ensure you have the '@modelcontextprotocol/sdk' installed. ```javascript import { Client } from '@modelcontextprotocol/sdk/client/index.js'; const client = new Client({ name: 'my-mcp-client', version: '1.0.0', }, { capabilities: {} }); // Connect with OAuth support await client.connect('https://mcp.agent.ai/mcp'); // List available tools const tools = await client.request({ method: 'tools/list' }, ListToolsResultSchema); // Call a tool const result = await client.request({ method: 'tools/call', params: { name: 'tool-name', arguments: { /* tool arguments */ } } }, CallToolResultSchema); ``` -------------------------------- ### Presenting Findings With Examples Source: https://docs.agent.ai/knowledge-agents/best-practices Use concrete examples in system instructions to show the AI the desired output format, ensuring consistency and quality. ```text Present research findings in this format: ## [Company Name] - Industry: [industry] - Size: [employee count] - Funding: [total raised] **Key People:** - [Name] - [Title] - [Name] - [Title] **Recent News:** - [News item 1] - [News item 2] **Competitive Positioning:** [Analysis paragraph] Sources: [List sources used] ``` -------------------------------- ### Example of Forking for Customization Source: https://docs.agent.ai/knowledge-agents/conversations Demonstrates how a user can fork a conversation to adapt a builder's example to their specific needs. ```text Builder shares: "Here's how to research competitors" User forks: Continues with their own competitor list ``` -------------------------------- ### Example System Instructions: Marketing Assistant Source: https://docs.agent.ai/knowledge-agents/configuration An example of system instructions for a marketing assistant, outlining its role in creating marketing content, its capabilities, and specific workflows. ```markdown You are a marketing strategist trained on our brand guidelines and past campaigns. Your role is to help users create effective marketing content and campaigns. You can: - Understand campaign goals and target audiences - Generate content ideas based on our brand voice - Use the "Content Generator" workflow to create drafts - Use the "Competitor Analysis" workflow to research competitors - Schedule social media posts using the "Social Poster" workflow When creating campaigns: 1. Ask clarifying questions about goals, audience, and timeline 2. Research competitors if needed using your workflow tool 3. Draft content that matches our brand voice (check your knowledge base) 4. Get user approval before executing any posting or publishing Our brand voice is: [describe tone - professional, friendly, etc.] Always prioritize brand consistency. If unsure about brand guidelines, check your knowledge base first. Never post publicly without explicit user approval. ``` -------------------------------- ### Example System Instructions: Development Assistant Source: https://docs.agent.ai/knowledge-agents/configuration An example of system instructions for a development assistant, detailing its function in supporting developers with codebase questions, testing, and deployment. ```markdown You are a development assistant familiar with our codebase and development practices. You help developers by: - Answering questions about our architecture and APIs - Running tests using the "Test Runner" workflow - Creating pull requests using the "Create PR" workflow - Deploying to staging using the "Deploy" workflow When developers ask you to run tests or deploy: 1. Confirm which environment or test suite they want 2. Execute the appropriate workflow 3. Report results clearly, including any failures 4. Suggest next steps based on results Reference our API documentation and architecture docs in your knowledge base when explaining technical concepts. Only deploy to production if explicitly requested AND tests have passed. Always create PRs for review - never push directly to main. ``` -------------------------------- ### Support and Troubleshooting Example Source: https://docs.agent.ai/knowledge-agents/conversations An example of how shared conversations can be used to demonstrate issues to support or the agent builder for troubleshooting. ```text If something isn't working: - Create a conversation showing the issue - Share with support or the agent builder - They can see exactly what happened ``` -------------------------------- ### Loop with Counter Example Source: https://docs.agent.ai/builder/template-variables This example demonstrates using a loop to iterate through deals and count those with an amount greater than 100000. ```text Loop through: {{all_deals}} Current item: `current_deal` Condition: {{current_deal.properties.amount}} > 100000 Value: {{high_value_count}} + 1 After loop: Use `{{high_value_count}}` ``` -------------------------------- ### System Instruction Version Control Example Source: https://docs.agent.ai/knowledge-agents/best-practices An example changelog for system instructions, detailing changes across different versions including added features, fixes, and removed elements. ```text Version 1.0 (2024-01-15) - Initial system instructions - Basic research capability Version 1.1 (2024-01-22) - Added: Explicit citation requirements - Added: HubSpot confirmation gates - Fixed: Too verbose responses Version 1.2 (2024-02-01) - Added: LinkedIn enrichment workflow - Updated: Research workflow order - Removed: Outdated policy reference ``` -------------------------------- ### Feedback Loop Prompt Example Source: https://docs.agent.ai/knowledge-agents/best-practices An example of system instructions for gathering user feedback after significant tasks, offering options for further assistance or adjustments. ```text After completing significant tasks: "How did that go? Let me know if you'd like me to: - Provide more detail - Try a different approach - Adjust anything" ``` -------------------------------- ### Create Contact Timeline Event for Onboarding Start Source: https://docs.agent.ai/recipes/hubspot-customer-onboarding Logs the start of customer onboarding on the contact record. Includes the deal ID and onboarding complexity. ```json { "object_type": "Contacts", "target_object_id": "{{primary_contact.id}}", "event_type": "customer_onboarding_start", "event_title": "Customer Onboarding Started", "event_description": "Onboarding kickoff for {{deal_data.properties.dealname}}", "event_properties": { "deal_id": "{{deal_id}}", "complexity": "{{onboarding_plan.complexity}}" } } ``` -------------------------------- ### Showcase Marketing Campaign Example Source: https://docs.agent.ai/knowledge-agents/conversations An example of how a shared conversation can be used to showcase marketing campaigns created by the knowledge agent. ```text Share great examples of your knowledge agent in action: - Marketing campaigns it created - Research it conducted - Code it helped debug - Reports it generated Use these as portfolio pieces or demos. ``` -------------------------------- ### Boolean Checks Examples Source: https://docs.agent.ai/actions/if_else Provides examples for checking boolean values, including 'is true', 'equals false', and checking for opt-out status. ```plain text [enrichment_complete] is true [contact emailoptout] equals false The contact has not unsubscribed ``` -------------------------------- ### Example MCP Server Use Case Source: https://docs.agent.ai/knowledge-agents/tools-integration An example illustrating how a custom internal company database search tool, built as an MCP server, can be used by a knowledge agent. ```text You built an internal company database search tool as an MCP server. Your knowledge agent can now search your proprietary data by calling this MCP tool. ``` -------------------------------- ### Example System Instruction for Announcing Tool Usage Source: https://docs.agent.ai/knowledge-agents/tools-integration This example system instruction demonstrates how to configure the agent to announce its tool usage to the end-user, specifying the tool name and the task it will accomplish. ```System Instructions When you call a tool, tell the user: 'Let me use [tool name] to [accomplish task]...' ``` -------------------------------- ### Example HubSpot Engagement Data Source: https://docs.agent.ai/actions/hubspot-v2-get-engagements This is an example of the JSON output returned by the Get Engagements V2 action, showing details for meetings, calls, emails, and notes. ```json [ { "id": "123456", "type": "meeting", "createdAt": "2025-01-15T14:00:00Z", "properties": { "hs_meeting_title": "Product Demo", "hs_meeting_body": "Demonstrated enterprise features, answered technical questions about integrations", "hs_meeting_outcome": "Scheduled", "hs_meeting_start_time": "2025-01-15T14:00:00Z", "hs_meeting_duration": "3600000" } }, { "id": "789012", "type": "call", "createdAt": "2025-01-10T10:30:00Z", "properties": { "hs_call_title": "Discovery Call", "hs_call_body": "Discussed requirements, budget, timeline. Strong interest in enterprise plan.", "hs_call_duration": "1800000", "hs_call_disposition": "Connected" } }, { "id": "345678", "type": "email", "createdAt": "2025-01-08T09:00:00Z", "properties": { "hs_email_subject": "Proposal for Acme Corp", "hs_email_text": "Attached is our proposal...", "hs_email_status": "SENT" } }, { "id": "901234", "type": "note", "createdAt": "2025-01-05T16:00:00Z", "properties": { "hs_note_body": "Follow-up from initial call. Need to connect with CTO about security requirements." } } ] ``` -------------------------------- ### Sample Questions: Specific and Actionable Examples Source: https://docs.agent.ai/knowledge-agents/configuration Shows how to write sample questions that are precise and encourage specific actions. ```text Good: - "Research the top 10 SaaS companies and their pricing models" - "Create a social media campaign for our new product launch" - "Run tests on the authentication module" - "Analyze our competitors' content strategy" Bad: - "Help me with research" - "Marketing stuff" - "Run some tests" - "Look at competitors" ``` -------------------------------- ### Successful API Response Source: https://docs.agent.ai/api-reference/social-media-%26-online-presence/get-twitter-users This is an example of a successful response from the Get Twitter Users API, returning a status code of 200 and a list of retrieved Twitter usernames. ```json { "status": 200, "response": [ "dharmesh" ] } ``` -------------------------------- ### System Instructions with Content Guidelines Source: https://docs.agent.ai/knowledge-agents/configuration This example shows how to integrate content filtering rules directly into the agent's system instructions. It includes guidelines for topic relevance, advice restrictions, and handling off-topic inquiries. ```text You are a [role]. [Main instructions...] Content Guidelines: - Only respond to questions about [topic area] - Do not provide [restricted advice] - If asked about [off-topic], say: "I specialize in [your area]. For [their topic], I recommend [alternative]." - Remain professional and helpful even if users are frustrated ``` -------------------------------- ### Manual Trigger Input Example Source: https://docs.agent.ai/integrations/hubspot-v2/foundation/04-triggers.md When using a manual trigger, you can provide starting data in JSON format. This data can then be accessed within the workflow using templating. ```json { "deal_stage": "closedwon", "start_date": "2025-01-01" } ``` -------------------------------- ### System Instructions for Workflow Tools Source: https://docs.agent.ai/knowledge-agents/tools-integration Provides an example of effective system instructions for a marketing assistant, detailing specific workflows to use for different user requests and outlining a multi-step process for handling competitor research and content generation tasks. ```text You are a marketing assistant with access to several workflows: - Use the "Competitor Research" workflow when users ask about competitors - Use the "Content Generator" workflow to create marketing content - Use the "Social Media Poster" workflow to schedule or publish posts When a user asks you to research competitors: 1. Call the Competitor Research workflow with the company names 2. Analyze the results 3. Present findings in bullet points 4. Ask if they want you to create content based on the research When creating content: 1. Ask clarifying questions about audience and goals 2. Use the Content Generator workflow 3. Show the user the draft 4. Get approval before using Social Media Poster workflow Never post publicly without explicit user approval. ``` -------------------------------- ### Generate Outreach Strategy Source: https://docs.agent.ai/api-reference/sales-outreach/%5Bos%5D-outreach-strategist Generates a personalized outreach strategy based on provided prospect and seller information. This can be used to book meetings, start relationships, re-engage contacts, or get referrals. ```APIDOC ## POST /v1/action/outreach_strategist_generate_outreach_strategy ### Description Generates a personalized outreach strategy based on provided prospect and seller information. This can be used to book meetings, start relationships, re-engage contacts, or get referrals. ### Method POST ### Endpoint /v1/action/outreach_strategist_generate_outreach_strategy ### Parameters #### Header Parameters - **Authorization** (string) - Required - Bearer token from your account (https://agent.ai/user/integrations#api) #### Request Body - **company_website** (string) - Required - The domain of the prospect's company. - **contact_name** (string) - Required - Full name of the person. - **outreach_goal** (enum) - Required - Shapes the entire strategy. Available options: `book_meeting`, `start_relationship`, `re_engage`, `get_referral`. Defaults to `book_meeting`. - **output_variable_name** (string) - Required - Variable name to store the strategy output. Pattern: `^[a-zA-Z][a-zA-Z0-9_]*$`. Defaults to `outreach_strategy`. - **linkedin_url** (string) - Optional - Prospect's LinkedIn URL. Significantly enriches output with warm-up suggestions. - **contact_role** (string) - Optional - Role when LinkedIn URL not provided. - **known_context** (string) - Optional - Mutual connections, prior interactions, anything the agent can't research. - **seller_product** (string) - Optional - Your product or service description. - **seller_icp** (string) - Optional - Who your ideal customer is. - **seller_website** (string) - Optional - Your company website. - **pain_points** (string) - Optional - Key pain points you address. ### Request Example ```json { "company_website": "", "contact_name": "", "outreach_goal": "book_meeting", "output_variable_name": "outreach_strategy", "linkedin_url": "", "contact_role": "", "known_context": "", "seller_product": "", "seller_icp": "", "seller_website": "", "pain_points": "" } ``` ### Response #### Success Response (200) - **status** (integer) - HTTP status code of the action response. - **response** (object) - Response data from the action. #### Response Example ```json { "status": 123, "response": {} } ``` ``` -------------------------------- ### Example API URL Source: https://docs.agent.ai/actions/invoke_web_api Enter the web address of the API you want to connect to. This information should be provided in the API documentation. ```text https://api.nasa.gov/planetary/apod?api_key=DEMO_KEY ``` -------------------------------- ### Correct Variable Syntax Examples Source: https://docs.agent.ai/builder/template-variables Illustrates the correct syntax for using variables and accessing properties. ```text Correct: * ✅ {{variable}} * ✅ {{variable.properties.property_name}} * ✅ {{variable[0]}} ``` -------------------------------- ### Get Recent Emails for Contact Communication History Workflow Source: https://docs.agent.ai/actions/hubspot-v2-get-engagements This workflow retrieves up to 50 recent emails sent to a contact, starting from 30 days ago, to check communication history. ```text Object Type: Contacts Object ID: {{contact_id}} Engagement Types: Select "Emails" Start Date: {{thirty_days_ago}} Limit: 50 Output Variable: recent_emails ``` -------------------------------- ### Add Workflow to System Instructions Source: https://docs.agent.ai/knowledge-agents/troubleshooting Include instructions in the system prompt that guide the agent on when to use a specific workflow. Provide clear examples of user requests and the corresponding workflow calls. ```text Add: "When users ask to [task], use the '[Workflow Name]' workflow. Example: User says 'research Company X' → call 'Company Research' workflow" ``` -------------------------------- ### Get LinkedIn Profile Details Source: https://docs.agent.ai/api-reference/social-media-%26-online-presence/get-linkedin-profile-details This example demonstrates how to use the `get_linkedin_profile` action to retrieve details for a specific LinkedIn profile. It requires an API token for authentication and the profile handle as a JSON payload. ```APIDOC ## POST /v1/action/get_linkedin_profile ### Description Fetches detailed information about a LinkedIn profile based on the provided profile handle. ### Method POST ### Endpoint https://api-lr.agent.ai/v1/action/get_linkedin_profile ### Parameters #### Request Body - **profile_handle** (string) - Required - The unique handle of the LinkedIn profile to retrieve. ### Request Example ```json { "profile_handle": "andreioprisan" } ``` ### Response #### Success Response (200) - **status** (integer) - The HTTP status code of the response. - **response** (object) - An object containing the LinkedIn profile details. - **awards** (array) - List of awards received by the profile. - **background_image** (string) - URL of the profile's background image. - **birth_date** (string) - The birth date of the profile (can be null). - **certifications** (array) - List of certifications held by the profile. - **contact_info** (object) - Contact information for the profile (can be null). - **courses** (array) - List of courses completed by the profile. - **education** (array) - List of educational background entries. - **entity_urn** (string) - The entity URN of the profile. - **first_name** (string) - The first name of the profile owner. - **industry** (string) - The industry the profile belongs to. - **influencer** (boolean) - Indicates if the profile owner is an influencer. - **languages** (object) - Language information for the profile. - **last_name** (string) - The last name of the profile owner. - **location** (object) - Location details of the profile. - **network_info** (object) - Information about the profile's network size. - **object_urn** (integer) - The object URN of the profile. - **open_to_work** (boolean) - Indicates if the profile is open to work. - **organizations** (array) - List of organizations the profile is associated with. - **patents** (array) - List of patents held by the profile. - **position_groups** (array) - List of work experience positions. #### Response Example ```json { "status": 200, "response": { "awards": [], "background_image": "https://media.licdn.com/dms/image/v2/C4E16AQHTt9ikcff1ug/profile-displaybackgroundimage-shrink_350_1400/profile-displaybackgroundimage-shrink_350_1400/0/1610553040149?e=1744848000&v=beta&t=G4AZnkKvbXyhH5QrXyLnT6rH-C8GvCareuLlaaEYAMc", "birth_date": null, "certifications": [ { "authority": "HubSpot", "company": { "id": null, "logo": "https://media.licdn.com/dms/image/v2/C4D0BAQF8H-SLmMDZlA/company-logo_400_400/company-logo_400_400/0/1646683330132/hubspot_logo?e=1747267200&v=beta&t=J096eUo6RubrWAbpGw4f0LX4wqW09zioGtdDCnMLfts", "name": "HubSpot", "url": null }, "date": { "end": { "day": null, "month": 1, "year": 2016 }, "start": { "day": null, "month": 12, "year": 2014 } }, "display_source": "hubspot.com", "license_number": null, "name": "Inbound Certification", "url": "http://academy.hubspot.com/certification" } ], "contact_info": null, "courses": [], "education": [ { "date": { "end": { "day": null, "month": 6, "year": 2006 }, "start": { "day": null, "month": null, "year": 2004 } }, "degree_name": "M.S.", "description": null, "field_of_study": "Management of Technology", "grade": null, "school": { "logo": "https://media.licdn.com/dms/image/v2/D560BAQH-UXRfIDIKug/company-logo_400_400/company-logo_400_400/0/1689799729035/mit_logo?e=1747267200&v=beta&t=KL3x2aO3w2ZaFnIj2cHddYIaShUHPJjMVtb3quAVF1w", "name": "Massachusetts Institute of Technology", "url": "https://www.linkedin.com/school/mit/" } }, { "date": { "end": { "day": null, "month": null, "year": null }, "start": { "day": null, "month": null, "year": null } }, "degree_name": "B.S.", "description": null, "field_of_study": "Computer Science", "grade": null, "school": { "logo": "https://media.licdn.com/dms/image/v2/D560BAQG26bKMbN1kmA/company-logo_400_400/company-logo_400_400/0/1667495412134/uab_logo?e=1747267200&v=beta&t=Xs7Xru1b7O3-BYyHOAq0kV77PtLl0v2RVjj3yWmJ-qo", "name": "University of Alabama at Birmingham", "url": "https://www.linkedin.com/school/uab/" } } ], "entity_urn": "ACoAAAAKDWUBlFAmXL1HBXFzTLscnoT1eYz66T8", "first_name": "Dharmesh", "industry": "Computer Software", "influencer": true, "languages": { "primary_locale": { "country": "US", "language": "en" }, "profile_languages": [ { "name": "English", "proficiency": "NATIVE_OR_BILINGUAL" }, { "name": "Gujarati", "proficiency": "NATIVE_OR_BILINGUAL" } ], "supported_locales": [ { "country": "US", "language": "en" } ] }, "last_name": "Shah", "location": { "city": null, "country": "United States", "default": "Greater Boston", "short": "Greater Boston", "state": null }, "network_info": { "connections_count": 500, "followable": true, "followers_count": 1095314 }, "object_urn": 658789, "open_to_work": false, "organizations": [], "patents": [], "position_groups": [ { "company": { "employees": { "end": 10000, "start": 5001 }, "id": 68529, "logo": "https://media.licdn.com/dms/image/v2/C4D0BAQF8H-SLmMDZlA/company-logo_400_400/company-logo_400_400/0/1646683330132/hubspot_logo?e=1747267200&v=beta&t=J096eUo6RubrWAbpGw4f0LX4wqW09zioGtdDCnMLfts", "name": "HubSpot", "url": "https://www.linkedin.com/company/hubspot/" }, "date": { "end": { "day": null, "month": null, "year": null }, "start": { "day": null, "month": 6, "year": 2006 } }, "profile_positions": [ { "company": { "employees": { "end": 10000, "start": 5001 }, "id": 68529, "logo": "https://media.licdn.com/dms/image/v2/C4D0BAQF8H-SLmMDZlA/company-logo_400_400/company-logo_400_400/0/1646683330132/hubspot_logo?e=1747267200&v=beta&t=J096eUo6RubrWAbpGw4f0LX4wqW09zioGtdDCnMLfts", "name": "HubSpot", "url": "https://www.linkedin.com/company/hubspot/" }, "date": { "end": { "day": null, "month": null, "year": null }, "start": { "day": null, "month": 6, "year": 2006 } }, "description": null, "job_title": "Founder & CEO", "location": "Cambridge, MA", "starts_on": { "day": null, "month": 6, "year": 2006 }, "title": "Founder & CEO", "to_date": null, "to_period": null, "update_time": 1677647880000, "visibility": "PUBLIC" } ] } ] } } ``` -------------------------------- ### Successful Response for Get HubSpot Owners Source: https://docs.agent.ai/api-reference/hubspot/get-hubspot-owners This is an example of a successful JSON response when retrieving HubSpot owners. It includes a status code and a list of owner objects, each with details like ID, email, name, and associated teams. ```JSON { "status": 200, "response": [ { "id": "12345", "email": "sarah.jones@company.com", "firstName": "Sarah", "lastName": "Jones", "createdAt": "2022-05-10T09:30:22.123Z", "updatedAt": "2024-01-18T14:22:45.789Z", "teams": [ "Sales", "Marketing" ], "userRole": "Super Admin" }, { "id": "67890", "email": "mike.smith@company.com", "firstName": "Mike", "lastName": "Smith", "createdAt": "2022-07-15T10:45:33.456Z", "updatedAt": "2023-12-05T16:18:21.345Z", "teams": [ "Sales" ], "userRole": "Standard" } ] } ``` -------------------------------- ### Example Filter: Professional boundaries Source: https://docs.agent.ai/knowledge-agents/configuration This filter defines professional boundaries by preventing the agent from offering specific types of advice (legal, medical, financial). It guides the agent to present information and suggest consulting professionals instead. ```text Do not provide: - Legal advice - Medical advice - Financial investment recommendations Instead, present information and recommend consulting professionals. ``` -------------------------------- ### Python Serverless Function Example Source: https://docs.agent.ai/api-reference/workflow-%26-logic/call-serverless-function This Python code demonstrates a basic serverless function handler. It processes JSON payloads from POST requests or query parameters from GET requests, returning a structured response with CORS headers. It includes error handling for invalid JSON. ```python import json def lambda_handler(event, context): agent_context = {} # Handle POST requests if event and 'body' in event and event['body']: try: event_json = json.loads(event['body']) agent_context = event_json.get('context', event_json) except json.JSONDecodeError: # Handle case where body isn't valid JSON agent_context = {"error": "Invalid JSON in request body"} # Handle GET requests elif event and 'queryStringParameters' in event and event['queryStringParameters']: agent_context = event['queryStringParameters'] # Handle API Gateway format for both elif event and 'pathParameters' in event and event['pathParameters']: agent_context = event['pathParameters'] # Prepare response body body = { "message": "Go Agent.AI Serverless Python Functions v1.0! Your function executed successfully!", "input": event, "context": agent_context } # Include CORS headers for browser access headers = { "Content-Type": "application/json", "Access-Control-Allow-Origin": "*", "Access-Control-Allow-Headers": "Content-Type", "Access-Control-Allow-Methods": "OPTIONS,POST,GET" } response = { "statusCode": 200, "headers": headers, "body": json.dumps(body) } return response ``` -------------------------------- ### AI-Generated Onboarding Plan Example Source: https://docs.agent.ai/integrations/hubspot-v2/workflows/customer-onboarding.md Example of the detailed onboarding plan generated by Agent.AI for a specific deal, including complexity, stakeholders, technical requirements, timeline, milestones, and risks. ```json { "complexity": "High", "stakeholders": "VP of Engineering (John Doe - primary), CTO (mentioned in demo call), IT Manager (security discussions), 3 engineering team members attended technical deep-dive", "technical_requirements": "SSO integration required, custom API endpoints for internal tools, data migration from legacy system, dedicated environment for testing, compliance review for data handling", "timeline_days": 90, "milestones": [ "Week 1-2: Kickoff call, technical discovery, SSO setup", "Week 3-6: Core implementation, API integration, data migration planning", "Week 7-12: Testing, training sessions, compliance review, go-live preparation" ], "risks": "Complex SSO requirements may delay timeline. Data migration complexity not fully scoped. Multiple stakeholders need alignment. Customer mentioned tight deadline for Q1 launch.", "welcome_message": "Welcome to Acme Corp! This is a high-value enterprise customer with sophisticated technical requirements. VP of Engineering John Doe is your primary contact and has been very engaged throughout the sales process. Key focus: deliver SSO and API integration within 90 days to meet their Q1 launch deadline. Multiple stakeholders need coordination - schedule kickoff call with all parties ASAP." } ``` -------------------------------- ### Get Report Section Source: https://docs.agent.ai/llms.txt Get a specific section from a research report. ```APIDOC ## Get Report Section ### Description Get a specific section from a research report. ### Method GET ### Endpoint /api/reference/company-research/[cr4]-get-report-section ### Query Parameters - **report_id** (string) - Required - The ID of the research report. - **section_name** (string) - Required - The name of the section to retrieve. ``` -------------------------------- ### Sample Questions Format in Builder Source: https://docs.agent.ai/knowledge-agents/configuration Shows how to input multiple sample questions in the builder interface, with each question on a new line. ```text Research the latest AI automation trends Find information about sustainable energy startups Analyze competitive landscape for CRM tools Summarize key insights from tech industry news ``` -------------------------------- ### Example Output of Created Engagement Source: https://docs.agent.ai/actions/hubspot-v2-create-engagement This is an example of the JSON output returned after successfully creating an engagement. ```json { "id": "123456789", "engagement_type": "note", "properties": { "hs_note_body": "AI Analysis: Deal shows strong engagement...", "hs_note_title": "Deal Health Analysis", "hs_timestamp": "2025-01-15T14:30:00Z", "hs_created_at": "2025-01-15T14:30:00Z" }, "createdAt": "2025-01-15T14:30:00Z", "updatedAt": "2025-01-15T14:30:00Z" } ``` -------------------------------- ### Get Full Report Source: https://docs.agent.ai/llms.txt Get a completed research report with all sections and optional HTML content. ```APIDOC ## Get Full Report ### Description Get a completed research report with all sections and optional HTML content. ### Method GET ### Endpoint /api/reference/company-research/[cr3]-get-full-report ### Query Parameters - **report_id** (string) - Required - The ID of the research report. - **include_html** (boolean) - Optional - Whether to include HTML content. ``` -------------------------------- ### Configure Standard I/O (Legacy) Source: https://docs.agent.ai/mcp-server This configuration is for Claude Desktop to connect using the original NPM package method. It requires an API token set as an environment variable. Replace YOUR_API_TOKEN_HERE with your actual token. ```json { "mcpServers": { "agentai": { "command": "npx", "args": ["-y", "@agentai/mcp-server"], "env": { "API_TOKEN": "YOUR_API_TOKEN_HERE" } } } } ``` -------------------------------- ### Start Company Research Source: https://docs.agent.ai/llms.txt Start researching a company by domain. Returns report_id for polling status. ```APIDOC ## Start Company Research ### Description Start researching a company by domain. Returns report_id for polling status. ### Method POST ### Endpoint /api/reference/company-research/[cr1]-start-company-research ### Request Body - **domain** (string) - Required - The domain of the company to research. ``` -------------------------------- ### Successful Response Example Source: https://docs.agent.ai/api-reference/business-%26-financial-data/company-earnings-info This is an example of a successful 200 OK response when retrieving company earnings information. ```json { "status": 200, "response": "Operator: Good afternoon and welcome to the HubSpot Q2 2024 Earnings Call. My name is Harry and I will be your operator today." } ``` -------------------------------- ### Prompt Hint Best Practice: Showing Format Source: https://docs.agent.ai/knowledge-agents/configuration Demonstrates how prompt hints can show users the expected format for their requests. ```text Good: "Example: Research [company name] and competitors" Bad: "Ask anything" ``` -------------------------------- ### Presenting Findings Without Examples Source: https://docs.agent.ai/knowledge-agents/best-practices When instructing an AI on output formatting, providing examples is more effective than general statements. ```text Present research findings clearly. ``` -------------------------------- ### Tip: Define the Workflow Source: https://docs.agent.ai/knowledge-agents/configuration Shows how to effectively define a workflow within system instructions by providing a step-by-step process, contrasting a good example with a bad one. ```markdown Good: "When researching companies: 1) Check knowledge base first, 2) Use Company Research tool, 3) Present findings in bullet points, 4) Ask if they want more details." Bad: "Research companies when asked." ``` -------------------------------- ### Example Webhook for YouTube Summary Agent Source: https://docs.agent.ai/builder/overview This example demonstrates triggering an agent via webhook to summarize a YouTube video and send the summary to an email address. Replace placeholders with a YouTube URL and your email address. ```bash curl -L -X POST -H 'Content-Type: application/json' \ 'https://api-lr.agent.ai/v1/agent/2uu8sx3kiip82da4/webhook/7a1e56b0' \ -d '{"user_input_url":"REPLACE_ME","user_email":"REPLACE_ME"}' ``` -------------------------------- ### Example System Instructions: Research Assistant Source: https://docs.agent.ai/knowledge-agents/configuration An example of system instructions for a research assistant agent, detailing its role, capabilities, how to handle research requests, and specific tool usage. ```markdown You are a research assistant that helps users conduct thorough research and analysis. You can: - Search your knowledge base for information on topics you've been trained on - Use the web research tool to find current information online - Analyze data and generate insights - Synthesize information from multiple sources When users ask you to research something: 1. First, search your knowledge base for relevant information 2. If you need current data or information not in your knowledge, use the web research tool 3. Present findings in a clear, organized format with sources cited 4. Ask if they want you to dig deeper into any specific aspect Use the "Company Research" workflow when users ask about specific companies. Use the "Web Search" workflow when you need current events or news. Always cite your sources. If you're not confident about something, say so. Never make up information - use your tools to find real data. ``` -------------------------------- ### String Comparisons Examples Source: https://docs.agent.ai/actions/if_else Demonstrates various ways to compare string values, including equality, exact matching, and checking for containment. ```plain text [contact lifecycle_stage] equals "lead" [deal stage] is "closedwon" [company industry] contains "technology" ``` -------------------------------- ### Collaborative Work Example Source: https://docs.agent.ai/knowledge-agents/conversations An example of using shared conversations for collaborative work, allowing colleagues to fork and continue discussions. ```text Work with someone on a project: - Start conversation with your knowledge agent - Get to a point where you want input - Share link with colleague - They can fork and continue ``` -------------------------------- ### Tip: Be Specific About Tools Source: https://docs.agent.ai/knowledge-agents/configuration Illustrates the importance of being specific when defining tool usage in system instructions, contrasting a good example with a bad one. ```markdown Good: "Use the 'Email Sender' workflow when users ask you to send emails or notify someone." Bad: "You can send emails." ```