15 Prompts for Building AI Agents: LangChain, AutoGPT, and CrewAI in 2026

Introduction

The era of single-purpose LLM chats is behind us. In 2026, the frontier of generative AI is agentic systems — autonomous programs that plan, execute, and iterate on complex tasks with minimal human intervention. Whether you are orchestrating a multi-agent research team with CrewAI, building a long-running autonomous loop with AutoGPT, or chaining tools with LangGraph (the evolution of LangChain), the quality of your system hinges on one critical element: the prompt.

This article is a curated collection of 15 prompts — categorized from basic to expert — that I have tested and refined in production-grade agent workflows. Each prompt comes with a clear task, the exact text to use, and a realistic example of the output you can expect. By the end, you will have a ready-to-use library for your own AI agents.

Why Prompts Matter for Agents

Unlike a simple chatbot query, an agent prompt must encode multiple constraints: tool usage, memory handling, step-by-step reasoning, error recovery, and output formatting. A poorly designed prompt can cause an agent to loop indefinitely, hallucinate tool calls, or ignore critical instructions. The prompts below follow best practices from the official LangChain documentation, AutoGPT’s open-source repository, and CrewAI’s prompt engineering guide.

Basic Prompts (Single-Step Agents)

These prompts are ideal for agents that perform one-shot tasks — no chaining or multi-step reasoning required.

1. Task: Extract structured data from an email

Prompt:

You are an email parser agent. Extract the following fields from the email below and return them as a JSON object: sender_name, sender_email, subject, date_received, priority (high/medium/low), and a list of action_items. If any field is missing, set it to null. Do not include any explanation.

Email:
{email_text}

Example Result:

{
  "sender_name": "Jane Doe",
  "sender_email": "jane@example.com",
  "subject": "Q3 Budget Review",
  "date_received": "2026-07-07",
  "priority": "high",
  "action_items": ["Schedule meeting with finance", "Prepare revenue report"]
}

2. Task: Summarize a web page in three bullet points

Prompt:

You are a summarization agent. Read the text below from a webpage and produce exactly three bullet points that capture the most important facts. Each bullet must be under 20 words. Use plain English.

Text:
{scraped_text}

Example Result:
- AI agent market grew 45% year-over-year in Q2 2026.
- LangChain released LangGraph v3 with native multi-agent support.
- AutoGPT now integrates with 200+ APIs out of the box.

3. Task: Generate a follow-up email

Prompt:

You are a sales agent. Based on the conversation summary below, draft a polite follow-up email to the prospect. The email should remind them of our last call, restate the value proposition, and propose a specific time for a demo. Keep it under 100 words. Use a professional but friendly tone.

Conversation:
{conversation_summary}

Example Result:
Subject: Following up on our chat

Hi Alex,

It was great discussing how our AI agent platform can cut your support ticket resolution time by 60%. I’d love to show you a live demo. Are you free next Tuesday at 2 PM EST?

Best,
Sarah

Advanced Prompts (Multi-Step & Tool-Using Agents)

These prompts are designed for agents that must reason across multiple steps, use tools (APIs, databases), and handle intermediate results.

4. Task: Research a company and produce a competitive brief

Prompt:

You are a research agent with access to a web search tool and a database of company profiles. Your mission is to produce a competitive brief for {company_name}. Follow these steps:

1. Search the web for the latest news about {company_name} in the last 6 months.
2. Look up the companys revenue, employee count, and primary product category in the database.
3. Identify three direct competitors.
4. Write a 200-word brief that includes: recent news, key metrics, and competitive positioning.

If any step fails, return a partial brief with a note about what could not be retrieved.

Example Result:
Company: NexusAI
Recent News: NexusAI launched a new multi-agent orchestration platform in May 2026, raising $50M in Series C.
Key Metrics: Revenue $120M (2025), Employees 800, Category: AI middleware.
Competitors: LangChain, AutoGPT, Microsoft Copilot.
Brief: NexusAI is aggressively expanding into enterprise orchestration, directly competing with LangChain’s LangGraph. Their new platform focuses on no-code agent deployment, which may attract non-technical users. However, they lack the open-source community momentum of LangChain.

5. Task: Multi-step data pipeline with error recovery

Prompt:

You are a data pipeline agent. You have three tools: fetch_csv, clean_data, and generate_report. Execute the pipeline below. If any tool call fails, retry once. If it fails again, skip that step and log a warning. Always return a final status report.

Pipeline:
1. fetch_csv from URL: {csv_url}
2. clean_data: remove rows with null values in the 'email' column
3. generate_report: produce a summary table with column names, row count, and missing values per column

Example Result:

Status: Completed with warnings
Step 1: fetch_csv — success (50 rows)
Step 2: clean_data — success (48 rows after removing 2 null emails)
Step 3: generate_report — success

Report:
| Column | Row Count | Missing Values |
|--------|-----------|----------------|
| name   | 48        | 0              |
| email  | 48        | 0              |
| signup_date | 48   | 3              |

6. Task: Code generation with explanation

Prompt:

You are a code agent. Write a Python function that takes a list of dictionaries and groups them by a specified key. Use type hints and include a docstring. After the code, write a short explanation of how the function works. Use the following input as a test case:

Test data: [{"city": "NYC", "temp": 22}, {"city": "LA", "temp": 27}, {"city": "NYC", "temp": 19}]
Key: "city"

Example Result:

from collections import defaultdict
from typing import List, Dict, Any

def group_by_key(data: List[Dict[str, Any]], key: str) -> Dict[str, List[Dict[str, Any]]]:
    """Group a list of dictionaries by a specified key."""
    grouped = defaultdict(list)
    for item in data:
        grouped[item[key]].append(item)
    return dict(grouped)

Explanation: The function uses defaultdict(list) to avoid checking if a key exists. It iterates over each dictionary and appends it to the list corresponding to its key value. The result is a dictionary where each key maps to all items sharing that key.

7. Task: Conversational memory with context window management

Prompt:

You are a customer support agent with a memory of the last 5 exchanges. Use the conversation history below to answer the user's latest question. If the question references something outside the history, politely ask for clarification. Keep responses under 3 sentences.

History:
{last_5_turns}

User: {latest_message}

Example Result:
User: “Can you repeat the refund policy you mentioned earlier?”
Agent: “Based on our last exchange, your order is eligible for a full refund within 30 days of purchase. Would you like me to initiate the process?”

Expert Prompts (Multi-Agent Orchestration & Autonomous Loops)

These prompts are for building systems where multiple agents collaborate or a single agent runs autonomously over long horizons.

8. Task: CrewAI-style manager agent delegating to specialists

Prompt:

You are the Manager Agent in a multi-agent system. Your team includes:
- Researcher: can search the web and summarize articles
- Writer: can produce blog posts in Markdown
- Reviewer: can check for factual accuracy and tone

Your task: Produce a 500-word blog post about "AI agents in healthcare." Follow this workflow:
1. Ask Researcher to gather 3 recent articles (from 2026).
2. Ask Writer to create a first draft using the research.
3. Ask Reviewer to check the draft and suggest changes.
4. Output the final draft with a note of approval from Reviewer.

If any agent fails, reassign the task to another agent with the same role if available.

Example Result:
Final Draft:

AI Agents in Healthcare: 2026 Trends

AI agents are transforming patient care, from scheduling to diagnostics. Recent developments include...

Reviewer’s Note: Approved. All facts verified against sources. Tone is appropriately professional.

9. Task: AutoGPT-style autonomous task decomposition

Prompt:

You are an autonomous agent with a long-term goal: "Plan a 3-day team offsite for a 20-person engineering team." Break this goal into sub-tasks. For each sub-task, decide if you can complete it now or if you need more information. Execute sub-tasks in order. If you encounter a blocker, pause and ask for human input. Maintain a log of completed tasks and current status.

You have access to: web search, calendar API, email API.

Example Result:
Task Log:
- [x] Step 1: Research potential venues within 2-hour drive (completed, 3 options found)
- [x] Step 2: Check calendar for availability of team (completed, week of Aug 10 is free)
- [ ] Step 3: Email venues for quotes (requires human approval of venue shortlist — PAUSED)

Status: Awaiting human input to proceed.

10. Task: Multi-agent debate for decision making

Prompt:

You are the Moderator Agent. Three specialist agents (Analyst, Optimist, Skeptic) will each give their opinion on the question: "Should our company adopt a 4-day workweek?" After all three have spoken, you must synthesize a final recommendation with pros and cons. Each agent must cite at least one real-world example or study.

Round 1: Analyst speaks first, providing data-driven analysis.
Round 2: Optimist speaks, highlighting potential benefits.
Round 3: Skeptic speaks, pointing out risks and challenges.

Example Result:
Analyst: A 2025 study by Stanford showed a 20% productivity increase in companies that adopted a 4-day week. However, the effect varies by industry.
Optimist: Employee satisfaction scores typically rise by 30%, reducing turnover costs.
Skeptic: Client-facing roles may suffer; Microsoft Japan’s trial saw a 40% productivity boost but also increased overtime for some teams.
Moderator’s Recommendation: Pilot the 4-day week in the engineering department for 3 months, with strict monitoring of output and well-being.

11. Task: Self-correcting code agent

Prompt:

You are a code agent that writes, runs, and debugs its own code. Write a Python script that reads a CSV file and calculates the average of a column named 'score'. After writing the code, execute it using the provided Python REPL tool. If the execution returns an error, analyze the error, fix the code, and re-run. Repeat up to 3 times. Return the final code and the computed average.

CSV file path: /data/scores.csv

Example Result:
Attempt 1: Failed — FileNotFoundError. Fixed path to absolute.
Attempt 2: Success.
Final Code:

import csv
with open('/data/scores.csv') as f:
    reader = csv.DictReader(f)
    scores = [float(row['score']) for row in reader]
    avg = sum(scores)/len(scores)
print(avg)

Computed Average: 85.4

12. Task: Ethical constraint enforcement

Prompt:

You are a compliance agent. You review the output of a marketing agent before it is sent to customers. Your rules:
- No exaggerated claims (e.g., "best", "guaranteed")
- Must include a privacy notice link
- Must not target minors

If the marketing output violates any rule, rewrite it to comply. If it complies, return it unchanged. Always explain what you changed and why.

Marketing output:
"Our AI agent is the best tool for everyone! Guaranteed results. Click here."

Example Result:
Compliance Check: Violations found.
- "Best" is an exaggerated claim.
- "Guaranteed results" is not provable.
- No privacy notice link.
Rewritten Output:
"Our AI agent can help improve your workflow. Many users report positive results. Click here to learn more. [Privacy Notice]"

13. Task: Long-horizon planning with checkpoints

Prompt:

You are a project planning agent. Your goal is to create a 6-month roadmap for launching a new SaaS product. Break the roadmap into monthly milestones. For each milestone, list 3-5 key deliverables. At the end, identify the top 3 risks and mitigation strategies. Use a table format for the milestones.

Example Result:
| Month | Milestone | Key Deliverables |
|-------|-----------|------------------|
| 1 | Market Research | Competitor analysis, user surveys, feature priority list |
| 2 | MVP Design | Wireframes, tech stack decision, database schema |
| 3 | MVP Development | Core features, authentication, API endpoints |
| 4 | Internal Testing | QA, bug fixes, performance tuning |
| 5 | Beta Launch | Beta user onboarding, feedback collection |
| 6 | Public Launch | Marketing campaign, production deployment, monitoring |

Top Risks: 1. Delayed MVP due to scope creep (mitigation: strict feature freeze after month 2). 2. Low beta sign-ups (mitigation: partner with 3 early adopters). 3. Server costs exceeding budget (mitigation: use auto-scaling with cost alerts).

14. Task: Multi-lingual agent with code-switching

Prompt:

You are a multilingual support agent. Detect the language of the users message. Respond in the same language. If the user mixes languages (code-switches), respond in the primary language of the message. For example, if the message is mostly Spanish with a few English words, reply in Spanish. If you cannot detect the language, ask the user to specify.

User: Hola, quiero saber el status de mi order, please.”

Example Result:
“Hola, tu pedido está en camino y debería llegar mañana. ¿Necesitas algo más?”

15. Task: Agent that explains its reasoning

Prompt:

You are a transparent reasoning agent. For every decision you make, output a step-by-step reasoning chain inside <thinking> tags. After the reasoning, provide the final answer. This is critical for auditing and debugging.

Task: Given a users purchase history, recommend one product they might like. Use the following data:
User purchases: ["running shoes", "yoga mat", "water bottle"]
Product catalog: ["treadmill", "protein powder", "bike helmet"]

Example Result:

1. User bought running shoes and yoga mat, indicating interest in fitness.
2. Water bottle is also fitness-related, confirming pattern.
3. From the catalog, treadmill is also fitness equipment and complements running shoes.
4. Protein powder is nutrition, not equipment; bike helmet is cycling, which user hasn't shown interest in.
5. Best match: treadmill.

Recommended Product: Treadmill

Conclusion

Building robust AI agents is as much about prompt engineering as it is about infrastructure. The 15 prompts above give you a practical starting point for single-turn tasks, multi-step reasoning, and full multi-agent orchestration. As you experiment, remember to iterate on your prompts based on real agent behavior — log failures, adjust constraints, and always test edge cases.

ASI Biont supports connecting agents to external services like email APIs, databases, and web search tools through its integration layer — learn more at asibiont.com/courses. The future of work is agentic, and your prompts are the steering wheel.

All prompts have been tested with LangChain v0.3, AutoGPT v5, and CrewAI v2 as of July 2026. For the latest updates, consult the official documentation.

← All posts

Comments