- Customize the instructions and tools for your own agent needs.
- Select a different template.
You’ll interact with your agent through chat, just like texting a helpful assistant.
Before you start
You’ll need:- A LangSmith account (sign up here).
- A Gmail account.
- A Google calendar.
- An OpenAI or Anthropic API key (Step 1 will show you how to get one).
1. Get your API key
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.- OpenAI (ChatGPT)
- Anthropic (Claude)
- Go to platform.openai.com/api-keys.
- Click Create new secret key.
- Give it a name like “Agent Builder”.
- Copy the key (it starts with
sk-). - Save it somewhere safe, you’ll need it in Step 2.
Cost: Both services charge based on use.
2. Add your API key to LangSmith
Now you’ll add your API key to LangSmith so your agents can use it:1
Open Settings
- Go to smith.langchain.com.
- Click the Settings icon in the bottom left.
2
Go to Secrets
Click the Secrets tab at the top.
3
Add your key
- Click Add secret.
- For Key, enter:
OPENAI_API_KEY(if using OpenAI)ANTHROPIC_API_KEY(if using Anthropic)
- For Value, paste the API key you copied in Step 1.
- Click Save secret.
Your agent now has access to an AI model to understand and respond to your requests. Next, you’ll create your agent.
3. Create your agent
1
Navigate to Agent Builder
- In the LangSmith UI, click Switch to Agent Builder at the top of the left-hand navigation.
2
Choose a template
- Select Templates in the left-hand navigation.
- Select Email Assistant template.
- Click Use this template.
3
Authorize accounts
Your agent will ask you to connect your Google accounts:
- Click Connect.
- Sign in with your Google account.
- Review permissions and click Allow.
- You’ll be redirected back to LangSmith where your agent will be created.
Your agent only accesses your accounts when working on tasks you give it. You can revoke access anytime in your Google account settings.
4. View the agent template
1
View and customize the template
At this point, you can review the template instructions for the email assistant. If needed, you can make adjustments to the instructions.If you made any changes, click Save changes.
2
Start a test chat
- In the right-hand panel of the configuration page, select the Test Chat tab.
-
Try out the email assistant in the chat interface, for example:
Apply a “Review” label to emails that I receive, which require some kind of review from me
3
Agent starts working
Your agent will start work and provide a Continue option for each step that requires your approval.

- As you test out the agent, you can make edits to the instructions, or add tools that you may need. Click Save changes when you’re happy with the results.
Edit your agent
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:- From My Agents in the left-hand navigation, select the agent you want to edit.
- Select Edit Agent.
- Add tools with + Add tool to connect more apps and services like Slack, GitHub, or Linear.
- Add further helpers with + Add sub-agent to break complex tasks into specialized sub-tasks.
- Request pauses for reviews on existing tools.
- Modify existing tools.
- Explore features that can trigger your agent to start a task.
Next steps
Now that you’ve created your first agent, here’s what to explore:Try more templates
Explore pre-built agents for common tasks
Add automation
Run your agent automatically with triggers (Slack, email, schedules)
Connect more tools
Add Slack, GitHub, Linear, and more
Build complex agents
Use sub-agents to break down big tasks
