connect-agent

Connect an existing AI agent to LangWatch simulations for scenario testing.

3.5k|362|Updated Sep 9, 2023
One-click install
npx skills add https://github.com/langwatch/langwatch --skill connect-agent
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: connect-agent
Source: https://github.com/langwatch/langwatch/tree/main/skills/_compiled/native/connect-agent
Command: npx skills add https://github.com/langwatch/langwatch --skill connect-agent

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires langwatch, zod.

What problem does it solve?

Running LangWatch scenario test suites against a real agent requires wiring the platform to the agent's actual process, and doing it wrong means testing a reimplementation instead of production code. This Skill adds a small connect function beside the service startup that registers the agent with LangWatch over an outbound SDK connection, so simulations exercise the real code, dependencies, and traces.

Core Features & Use Cases

  • SDK-based agent registration: Adds a connect_agent decorator (Python) or connectAgent function (TypeScript) on the existing startup path that opens an outbound connection and registers the agent with its environment and run parameters.
  • Run parameter declaration: Exposes typed parameters (Literal/Enum in Python, zod schemas in TypeScript) that appear in the platform's run dialog for comparison runs across models or configurations.
  • HTTP fallback registration: Registers agents over HTTP with body templates, bearer-token secrets, and traceparent middleware when the SDK cannot be imported.
  • Use Case: A team wants to regression-test their support agent before each release. The Skill wires the agent into LangWatch, confirms it reads Online, and runs a smoke test suite against the live process with judge-verified traces.

Quick Start

Ask the assistant to connect my agent to LangWatch simulations and run the first test suite against it.

Frequently Asked Questions about connect-agent

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I connect my AI agent to LangWatch simulations?

Install the langwatch SDK, add a connect_agent decorator (Python) or connectAgent function (TypeScript) beside your service startup that calls your existing agent, then start the service normally. Confirm the agent reads Online with langwatch agent list and run a test suite.

How do I declare run parameters for a LangWatch connected agent?

In Python, add typed parameters with defaults using Literal or Enum for closed option lists. In TypeScript, declare a zod schema in the parameters field. The platform shows them in the run dialog and validates supplied values against the schema.

Can I register an agent with LangWatch without the SDK?

Yes, use the HTTP fallback when the agent is in a language with no SDK or its code is unreachable. Register a public endpoint with langwatch agent create --type http, configure a body template and output path, and add a traceparent middleware so the judge can read traces.

Why does my LangWatch agent show Offline after starting the service?

Offline means the process is not connected: check that LANGWATCH_API_KEY is set in the process environment and that outbound WSS is allowed. On networks blocking WebSockets, set LANGWATCH_AGENT_TRANSPORT=http to register over HTTP long polling.

Does the connected agent need a traceparent middleware?

No. The SDK adopts the turn's trace context before calling the connect function, so spans land in the turn's trace automatically. The traceparent middleware is only required for the HTTP fallback registration path.