|
| 1 | +--- |
| 2 | +title: Build your first agent quickstart |
| 3 | +sidebarTitle: Quickstart |
| 4 | +--- |
| 5 | + |
| 6 | +Create your first AI agent step-by-step. No coding required. |
| 7 | + |
| 8 | +This will use a template to build a **Meeting Prep Assistant** that: |
| 9 | +- Checks your calendar for upcoming meetings. |
| 10 | +- Finds relevant emails about those meetings. |
| 11 | +- Creates a summary document with key discussion points. |
| 12 | + |
| 13 | +Feel free to follow along with this example or customize the instructions and tools for your own agent needs. |
| 14 | + |
| 15 | +<Callout icon="comment" color="#8B5CF6" iconType="regular"> |
| 16 | +You'll interact with your agent through chat, just like texting a helpful assistant. |
| 17 | +</Callout> |
| 18 | + |
| 19 | +## Before you start |
| 20 | + |
| 21 | +You'll need: |
| 22 | +- A LangSmith account ([sign up here](https://smith.langchain.com)). |
| 23 | +- A Gmail account. |
| 24 | +- A Google Calendar. |
| 25 | +- An OpenAI or Anthropic API key (Step 1 will show you how to get one). |
| 26 | + |
| 27 | +## Step 1. Get your API key |
| 28 | + |
| 29 | +Your agent needs an API key to connect to an AI model. The AI model is what allows your agent to understand and respond to your requests. |
| 30 | + |
| 31 | +<Tabs> |
| 32 | + <Tab title="OpenAI (ChatGPT)"> |
| 33 | + 1. Go to [platform.openai.com/api-keys](https://platform.openai.com/api-keys). |
| 34 | + 1. Click **Create new secret key**. |
| 35 | + 1. Give it a name like "Agent Builder". |
| 36 | + 1. Copy the key (it starts with `sk-`). |
| 37 | + 1. Save it somewhere safe, you'll need it in Step 2. |
| 38 | + </Tab> |
| 39 | + |
| 40 | + <Tab title="Anthropic (Claude)"> |
| 41 | + 1. Go to [console.anthropic.com/settings/keys](https://console.anthropic.com/settings/keys). |
| 42 | + 2. Click **Create Key**. |
| 43 | + 3. Give it a name like "Agent Builder". |
| 44 | + 4. Copy the key (it starts with `sk-ant-`). |
| 45 | + 5. Save it somewhere safe, you'll need it in Step 2. |
| 46 | + </Tab> |
| 47 | +</Tabs> |
| 48 | + |
| 49 | +<Info> |
| 50 | +**Cost:** Both services charge based on use. |
| 51 | +</Info> |
| 52 | + |
| 53 | +## Step 2. Add your API key to LangSmith |
| 54 | + |
| 55 | +Now you'll add your API key to LangSmith so your agents can use it: |
| 56 | + |
| 57 | +<Steps> |
| 58 | + <Step title="Open Settings"> |
| 59 | + 1. Go to [smith.langchain.com](https://smith.langchain.com). |
| 60 | + 2. Click the <Icon icon="gear" /> **Settings** icon in the bottom left. |
| 61 | + </Step> |
| 62 | + |
| 63 | + <Step title="Go to Secrets"> |
| 64 | + Click the **Secrets** tab at the top. |
| 65 | + </Step> |
| 66 | + |
| 67 | + <Step title="Add your key"> |
| 68 | + 1. Click **Add secret**. |
| 69 | + 2. For **Key**, enter: |
| 70 | + - `OPENAI_API_KEY` (if using OpenAI) |
| 71 | + - `ANTHROPIC_API_KEY` (if using Anthropic) |
| 72 | + 3. For **Value**, paste the API key you copied in Step 1. |
| 73 | + 4. Click **Save secret**. |
| 74 | + </Step> |
| 75 | +</Steps> |
| 76 | + |
| 77 | +<Callout type="success" icon="check" color="#10B981" iconType="regular"> |
| 78 | +Your agent now has access to an AI model to understand and respond to your requests. Next, you'll create your agent. |
| 79 | +</Callout> |
| 80 | + |
| 81 | +## Step 3. Create your agent |
| 82 | + |
| 83 | +<Steps> |
| 84 | + <Step title="Navigate to Agent Builder"> |
| 85 | + 1. In the [LangSmith UI](https://smith.langchain.com), click the <Icon icon="mouse-pointer"/> no-code toggle in the lower left-hand navigation. |
| 86 | + </Step> |
| 87 | + |
| 88 | + <Step title="Choose a template"> |
| 89 | + 1. Select **Templates** in the left-hand navigation. |
| 90 | + 1. Select **Email Assistant** template. |
| 91 | + 1. Click **Use this template**. |
| 92 | + |
| 93 | + <Tip> |
| 94 | + If you don't want to start with a template, you have two other options. From the **+ New Agent** page: |
| 95 | + - Use the chat interface to describe your agent, and it will help you create it step-by-step. |
| 96 | + - Select **Create manually instead** to build your agent without any pre-filled responses on the configuration page. |
| 97 | + </Tip> |
| 98 | + </Step> |
| 99 | + |
| 100 | + <Step title="Authorize accounts"> |
| 101 | + Your agent will ask you to connect your Google accounts: |
| 102 | + |
| 103 | + 1. Click **Connect**. |
| 104 | + 2. Sign in with your Google account. |
| 105 | + 3. Review permissions and click **Allow**. |
| 106 | + 4. You'll be redirected back to LangSmith where your agent will be created. |
| 107 | + </Step> |
| 108 | + |
| 109 | +</Steps> |
| 110 | + |
| 111 | +<Info> |
| 112 | +Your agent only accesses your accounts when working on tasks you give it. You can revoke access anytime in your Google account settings. |
| 113 | +</Info> |
| 114 | + |
| 115 | +## Step 4. Customize your agent |
| 116 | + |
| 117 | +<Steps> |
| 118 | + |
| 119 | + <Step title="Customize for meeting prep"> |
| 120 | + |
| 121 | + 1. When you use a template, you may want to edit the title and description at the top of the configuration page. |
| 122 | + 2. Update the **Instructions** field with the following: |
| 123 | + |
| 124 | + ``` |
| 125 | + You are a Meeting Prep Assistant. When I ask you to help me prepare for meetings: |
| 126 | +
|
| 127 | + 1. Check my Google Calendar for meetings today or tomorrow |
| 128 | + 2. For each meeting, search my Gmail for emails about that meeting (use meeting title keywords) |
| 129 | + 3. Create a summary document with: |
| 130 | + - Meeting name, time, and attendees |
| 131 | + - Key topics from emails |
| 132 | + - Any action items or decisions mentioned |
| 133 | + 4. Ask me if I want you to send this summary to myself via email |
| 134 | +
|
| 135 | + Always confirm before sending emails. |
| 136 | + ``` |
| 137 | + |
| 138 | + 3. Click **Save Changes**. |
| 139 | + </Step> |
| 140 | + |
| 141 | + <Step title="Start a test chat"> |
| 142 | + 1. In the right-hand panel of the configuration page, select the **Test Chat** tab. |
| 143 | + 2. Try out the email assistant in the chat interface: |
| 144 | + |
| 145 | + > _Help me prepare for my meetings today_ |
| 146 | + </Step> |
| 147 | + |
| 148 | + <Step title="Agent starts working"> |
| 149 | + Your agent will start work and provide a **Continue** option for each step that requires your approval. |
| 150 | + |
| 151 | + <img |
| 152 | + className="block dark:hidden" |
| 153 | + src="/langsmith/images/agent-builder-response.png" |
| 154 | + alt="Test chat output view with response including approvals for Gmail tool." |
| 155 | + /> |
| 156 | + |
| 157 | + <img |
| 158 | + className="hidden dark:block" |
| 159 | + src="/langsmith/images/agent-builder-response-dark.png" |
| 160 | + alt="Test chat output view with response including approvals for Gmail tool." |
| 161 | + /> |
| 162 | + |
| 163 | + </Step> |
| 164 | +</Steps> |
| 165 | + |
| 166 | +## Step 5. Review and approve |
| 167 | + |
| 168 | +<Steps> |
| 169 | + <Step title="Read the summary"> |
| 170 | + Your agent will present a meeting prep summary in chat. Review it for accuracy. |
| 171 | + </Step> |
| 172 | + |
| 173 | + <Step title="Give feedback (optional)"> |
| 174 | + If something isn't working well, tell your agent. For example: |
| 175 | + |
| 176 | + > _Can you also include links to the emails you found?_ |
| 177 | +
|
| 178 | + Your agent will update the summary. |
| 179 | + </Step> |
| 180 | + |
| 181 | + <Step title="Approve email send (if applicable)"> |
| 182 | + If your agent asks to send the summary via email, you'll see: |
| 183 | + |
| 184 | + **"I'd like to send this summary to you. Do you approve?"** |
| 185 | + |
| 186 | + Click **Approve** or **Edit** to modify before sending. |
| 187 | + </Step> |
| 188 | +</Steps> |
| 189 | + |
| 190 | +## Edit your agent |
| 191 | + |
| 192 | +You may want to update your agent's instructions or include more tools. You can directly chat with your agent to ask for updates, or you can: |
| 193 | + |
| 194 | +1. From **My Agents** in the left-hand navigation, select your **Meeting Prep Assistant** agent. |
| 195 | +1. Select <Icon icon="pencil"/> **Edit Agent**. |
| 196 | + |
| 197 | + <img |
| 198 | + className="block dark:hidden" |
| 199 | + src="/langsmith/images/agent-builder-edit-page.png" |
| 200 | + alt="Agent in edit mode with a visualization and options to add tools, sub-agents, and triggers." |
| 201 | + /> |
| 202 | + |
| 203 | + <img |
| 204 | + className="hidden dark:block" |
| 205 | + src="/langsmith/images/agent-builder-edit-page-dark.png" |
| 206 | + alt="Agent in edit mode with a visualization and options to add tools, sub-agents, and triggers." |
| 207 | + /> |
| 208 | + |
| 209 | +From the agent's edit page, you can: |
| 210 | + |
| 211 | +- Add tools with **+ Add tool** to connect more apps and services like Slack, GitHub, or Linear. |
| 212 | +- Add further helpers with **+ Add sub-agent** to break complex tasks into specialized sub-tasks. |
| 213 | +- Request pauses for reviews on existing tools. |
| 214 | +- Modify existing tools. |
| 215 | +- Explore features that can trigger your agent to start a task. |
| 216 | + |
| 217 | +## Next steps |
| 218 | + |
| 219 | +Now that you've created your first agent, here's what to explore: |
| 220 | + |
| 221 | +<CardGroup cols={2}> |
| 222 | + <Card title="Try more templates" icon="shapes" href="/langsmith/agent-builder-templates"> |
| 223 | + Explore pre-built agents for common tasks |
| 224 | + </Card> |
| 225 | + |
| 226 | + <Card title="Add automation" icon="bolt" href="/langsmith/agent-builder-essentials#triggers"> |
| 227 | + Run your agent automatically with triggers (Slack, email, schedules) |
| 228 | + </Card> |
| 229 | + |
| 230 | + <Card title="Connect more tools" icon="puzzle-piece" href="/langsmith/agent-builder-tools"> |
| 231 | + Add Slack, GitHub, Linear, and more |
| 232 | + </Card> |
| 233 | + |
| 234 | + <Card title="Build complex agents" icon="sitemap" href="/langsmith/agent-builder-essentials#sub-agents"> |
| 235 | + Use sub-agents to break down big tasks |
| 236 | + </Card> |
| 237 | +</CardGroup> |
0 commit comments