Connect your first agent
Connect a TypeScript or JavaScript agent application to E1 in a few steps. This guide uses the Ellipsis SDK with LangChain callbacks.Before you begin
Make sure you have:- Node.js 22 or later.
- An E1 account and an agent created in your organization’s workspace.
- The agent API key generated for that E1 agent.
- The E1 ingestion URL from the API reference.
- A LangChain application and the API key for the LLM provider you use.
@langchain/core version 1.1.0 or later.
1. Install the SDK
Install the package from npm:@langchain/google-genai.
2. Get your E1 connection details
You need two mandatory values:
To generate an agent API key:
- Sign in to E1, or create an account.
- Open your organization’s workspace.
- Create an agent.
- Generate an API key for that agent.
3. Configure environment variables
Store your connection details in environment variables rather than hardcoding credentials in your source files. Create a.env file in your project root:
dotenv, install it:
globalTags and globalMetadata are optional. They add context to telemetry collected by the SDK.
4. Initialize the SDK and create a handler
Initialize Ellipsis once at the top level of your application:debug, info, warn, error and silent. The default level is warn.
5. Pass the handler to your agent
Pass the handler through the LangChain callbacks option when invoking your agent:6. Run your application and inspect the trace
Execute your application as you normally would. Once the agent has run and telemetry has been exported, open your E1 workspace and inspect the corresponding agent. Depending on the events reported by the framework and model integration, you can inspect:- Trace and span hierarchies.
- Agent and chain executions.
- LLM provider and model information.
- Token consumption and prices per run.
- Execution duration and latency.
- Tool calls and associated operations.
- Errors and failed executions.
Complete integration pattern
The following illustrates the essential SDK integration points. Add the handler to the invocation of your existing LangChain agent:This is the instrumentation pattern, not a complete standalone agent. Your
application still needs its own model, tools and agent definition.
Continue learning
- TypeScript SDK — all documented configuration fields and runtime requirements.
- Weather Agent example — a complete example using LangChain, Gemini and a tool.

