LangChain

Give your LangChain agent a real phone number. Make calls, send messages, buy numbers, and manage voice agents — all through the langchain-agentphone package.

Get your API key from agentphone.to/settings. No Twilio account, no ngrok, no server needed.

Installation

$pip install langchain-agentphone

Set your API key as an environment variable:

$export AGENTPHONE_API_KEY="your_api_key_here"

Setup

Using the toolkit

The AgentPhoneToolkit gives your agent access to all 12 LangChain tools at once. Use selected_tools to expose only the capabilities you need.

1from langchain_agentphone import AgentPhoneToolkit
2from langchain.chat_models import init_chat_model
3from langgraph.prebuilt import create_react_agent
4
5model = init_chat_model(
6 model="claude-sonnet-4-6",
7 model_provider="anthropic",
8)
9
10# All 12 tools
11toolkit = AgentPhoneToolkit()
12agent = create_react_agent(model, toolkit.get_tools())
13
14response = agent.invoke({
15 "messages": [
16 ("user", "Send a text to +14155551234 saying 'Your order is ready!'")
17 ]
18})

Selecting specific tools

1# Only messaging
2toolkit = AgentPhoneToolkit(selected_tools=["send_sms"])
3
4# Calls and transcripts
5toolkit = AgentPhoneToolkit(
6 selected_tools=["make_call", "get_transcript", "list_calls"]
7)

Importing individual tools

1from langchain_agentphone import AgentPhoneSendSMS, AgentPhoneMakeCall
2
3send_sms = AgentPhoneSendSMS()
4make_call = AgentPhoneMakeCall()
5
6agent = create_react_agent(model, [send_sms, make_call])

Use cases

  • Autonomous phone calls — have your agent call a number and hold a full AI conversation, returning the transcript when done
  • SMS messaging — send and receive texts, manage conversation threads across multiple numbers
  • Phone number management — provision numbers with specific area codes, assign them to agents
  • AI voice agents — create agents with configurable voices, system prompts, and model tiers that handle calls autonomously
  • Appointment reminders — pull schedules from a calendar API and text or call customers with reminders
  • Lead qualification — call new leads within seconds, qualify interest, and book meetings automatically

Available tools

The package provides 12 LangChain tools:

ToolDescription
AgentPhoneSendSMSSend a message to a phone number
AgentPhoneMakeCallMake an AI-powered phone call
AgentPhoneGetTranscriptGet the transcript for a completed call
AgentPhoneListCallsList recent calls
AgentPhoneListConversationsList SMS conversation threads
AgentPhoneGetConversationGet messages in a conversation
AgentPhoneBuyNumberBuy a phone number with a specific area code
AgentPhoneListNumbersList your phone numbers
AgentPhoneCreateAgentCreate an AI phone agent
AgentPhoneListAgentsList your phone agents
AgentPhoneCreateContactCreate a contact
AgentPhoneListContactsList your contacts

Every tool has a full Pydantic schema so your LLM knows exactly what arguments to pass.

Resources