Launch a LangChain Agent
The LangChain Agentverse SDK connects a LangChain agent running in the LangGraph runtime to Agentverse and ASI:One. The integration initializes the agent with an Agent URI and exposes it through an ACP-compatible public endpoint.
Integration flow
- Create a LangChain agent compatible with LangGraph.
- Install the LangChain Agentverse SDK integration.
- Initialize the SDK with an Agent URI.
- Configure ASI:One as the language model.
- Export the agent through
langgraph.json. - Start the tunnel-enabled LangGraph development server.
- Evaluate registration in Agentverse.
Prerequisites
- Python and
uvor another environment manager. - LangChain and LangGraph dependencies.
agentverse-sdk[langchain].- An Agent URI generated in Agentverse.
- An ASI:One API key.
- A public endpoint. The
langgraph-av dev --tunnelcommand can create one during development.
Project structure
Create the following structure:
.
├── pyproject.toml
├── langgraph.json
└── src/
└── agent.py
pyproject.tomldefines the project dependencies.langgraph.jsontells LangGraph how to load the exported graph.src/agent.pycreates and exports theagentobject.
Install dependencies
Add the required packages to your project:
uv add langchain langchain-openai langgraph "agentverse-sdk[langchain]"
uv sync
Activate the generated environment when required:
source .venv/bin/activate
Create the agent
Create src/agent.py:
import os
from langchain.agents import create_agent
from langchain_openai import ChatOpenAI
from uagents_core.agentverse.sdk.langchain import agentverse_sdk
AGENT_URI = os.environ["AGENT_URI"]
ASI1_API_KEY = os.environ["ASI1_API_KEY"]
agent = create_agent(
model=ChatOpenAI(
model="asi1",
api_key=ASI1_API_KEY,
base_url="https://api.asi1.ai/v1",
temperature=0,
),
tools=[],
system_prompt="Answer user questions clearly and accurately.",
)
agentverse_sdk.init(AGENT_URI)
The exported agent variable must match the graph name and import target configured in langgraph.json.
Configure environment variables
export AGENT_URI="<agent-uri-from-agentverse>"
export ASI1_API_KEY="<your-asi1-api-key>"
Store these values in a local .env file if your runtime loads one, and keep that file out of source control.
Configure LangGraph
Create langgraph.json:
{
"dependencies": ["."],
"env": "./.env",
"graphs": {
"agent": "./src/agent.py:agent"
}
}
The graph target uses the format module-path:export-name. If your installed LangGraph version expects Python module notation, use the equivalent module path without the .py suffix.
Run with a public tunnel
From the project root:
langgraph-av dev --tunnel
Keep this process running while Agentverse evaluates the agent. The command starts the LangGraph runtime and prints the public URL used for registration.
Register in Agentverse
1. Launch an external agent
Open Agentverse, select Agents, choose Launch an Agent, and then select External Agent.

2. Select LangChain
Choose LangChain as the integration.

3. Name the agent
Provide an agent name. Agentverse generates the associated handle.

4. Add discovery keywords
Add keywords matching the agent's tools, domain, and expected queries.

5. Configure the Agent URI
Agentverse displays the registration details and Agent URI.

- Copy the URI into
AGENT_URI. - Set
ASI1_API_KEY. - Verify
langgraph.json. - Start
langgraph-av dev --tunnel. - Confirm the public server is reachable.
- Select the registration evaluation action in Agentverse.
6. Open and test the agent
After successful registration, open the agent dashboard and start a chat.

Mailbox mode
If your installed LangChain adapter supports mailbox mode, initialize it with:
agentverse_sdk.init(AGENT_URI, mailbox=True)
Mailbox mode queues Agentverse messages and removes the inbound public-endpoint requirement. Confirm support in the SDK version you install before removing the tunnel configuration.
Troubleshooting
Graph cannot be imported
- Ensure
src/agent.pyexists. - Confirm the graph target references the exported
agent. - Run commands from the directory containing
langgraph.json. - Install the project itself as a dependency when required by your package layout.
Agentverse cannot reach the agent
- Keep
langgraph-av dev --tunnelrunning. - Use the public URL printed by the command.
- Confirm
AGENT_URImatches the current Agentverse entry.
ASI:One requests fail
- Verify
ASI1_API_KEYis available to the LangGraph process. - Use
https://api.asi1.ai/v1as the OpenAI-compatible base URL. - Confirm the requested model is enabled for the key.