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.ai/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.

from langchain_agentphone import AgentPhoneToolkit
from langchain.chat_models import init_chat_model
from langgraph.prebuilt import create_react_agent
model = init_chat_model(
model="claude-sonnet-4-6",
model_provider="anthropic",
)
# All 12 tools
toolkit = AgentPhoneToolkit()
agent = create_react_agent(model, toolkit.get_tools())
response = agent.invoke({
"messages": [
("user", "Send a text to +14155551234 saying 'Your order is ready!'")
]
})

Selecting specific tools

# Only messaging
toolkit = AgentPhoneToolkit(selected_tools=["send_sms"])
# Calls and transcripts
toolkit = AgentPhoneToolkit(
selected_tools=["make_call", "get_transcript", "list_calls"]
)

Importing individual tools

from langchain_agentphone import AgentPhoneSendSMS, AgentPhoneMakeCall
send_sms = AgentPhoneSendSMS()
make_call = AgentPhoneMakeCall()
agent = 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