> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ellipsis1.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Install the Ellipsis SDK, configure your E1 agent and instrument a LangChain application.

# 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](https://docs.ellipsis1.com/api.md).
* A LangChain application and the API key for the LLM provider you use.

For LangChain and LangGraph instrumentation, the SDK requires `@langchain/core` version `1.1.0` or later.

## 1. Install the SDK

Install the package from npm:

```bash theme={null}
npm install @ellipsis1/sdk
```

For LangChain integrations, make sure your project includes the relevant LangChain packages. For example:

```bash theme={null}
npm install langchain @langchain/core
```

Install the provider package you use separately. The Weather Agent example uses Google Gemini through `@langchain/google-genai`.

## 2. Get your E1 connection details

You need two mandatory values:

| Value | Description |
| - | - |
| `ingestionUrl` | The E1 telemetry ingestion endpoint. Use the endpoint published in the API reference section. |
| `apiKey` | The agent API key generated from your E1 organization workspace. |

To generate an agent API key:

1. Sign in to [E1](https://app.ellipsis1.com), or create an account.
2. Open your organization's workspace.
3. Create an agent.
4. Generate an API key for that agent.

The key associates telemetry exported by your application with the corresponding agent in E1.

## 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 theme={null}
ELLIPSIS_INGESTION_URL=your_ingestion_url
ELLIPSIS_AGENT_API_KEY=your_agent_api_key
```

Load the variables before initializing the SDK. If you use `dotenv`, install it:

```bash theme={null}
npm install dotenv
```

Then create your configuration:

```typescript theme={null}
import "dotenv/config";
import { initEllipsis, type Config } from "@ellipsis1/sdk";

const config: Config = {
  ingestionUrl: process.env.ELLIPSIS_INGESTION_URL!,
  apiKey: process.env.ELLIPSIS_AGENT_API_KEY!,
  globalTags: ["getting-started"],
  globalMetadata: {
    name: "My first agent",
    version: "1.0.0",
    stage: "DEV",
  },
};
```

`globalTags` and `globalMetadata` are optional. They add context to telemetry collected by the SDK.

> [!WARNING]
>
> Add `.env` to your `.gitignore`. Never commit your E1 agent API key or an LLM
> provider API key to a public repository.

## 4. Initialize the SDK and create a handler

Initialize Ellipsis once at the top level of your application:

```typescript theme={null}
const ellipsis = initEllipsis(config, "info");
const handler = ellipsis.langchain();
```

The second argument is the optional SDK logging level. Supported levels are `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:

```typescript theme={null}
const result = await agent.invoke(
  {
    messages: [{ role: "user", content: "Your question here" }],
  },
  {
    callbacks: [handler],
  }
);
```

The Ellipsis handler captures supported execution events and exports telemetry to your E1 platform.

## 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:

```typescript theme={null}
import "dotenv/config";
import { initEllipsis, type Config } from "@ellipsis1/sdk";

const config: Config = {
  ingestionUrl: process.env.ELLIPSIS_INGESTION_URL!,
  apiKey: process.env.ELLIPSIS_AGENT_API_KEY!,
};

const ellipsis = initEllipsis(config);
const handler = ellipsis.langchain();

// Pass `handler` in the callbacks option of your agent invocation.
```

> [!NOTE]
>
> 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](https://docs.ellipsis1.com/sdk/typescript.md) — all documented configuration fields and runtime requirements.
* [Weather Agent example](https://docs.ellipsis1.com/examples/weather-agent.md) — a complete example using LangChain, Gemini and a tool.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.