Playground/LangChain
API ACTIVITY

Usage & budget

Your TypeSafe API key

Import your key to override the shared server default.

Saved on this browser until removed or site data is cleared. Masked on screen; sent only with Jev requests through this app. The saved value is never displayed.

Connecting
RUNNABLE TYPESCRIPT INTEGRATION

Jev × LangChain

Wrap Jev as a real LangChain tool. Return a policy-checked routing decision to your host application.

WORKSPACE GUIDE

LangChain

Try a typed routing tool with live classification or a mocked response.

Tool inputPolicy gateStructured result

What you provide

A user request and current graph node, passed to the real structured LangChain tool adapter.

What happens

The adapter validates input, restricts routing to allowed candidates, invokes live Jev or a mock, and applies deterministic policy.

What you get

A structured routing result for a calling application, including approval or policy stops. The adapter never executes the selected downstream tool.

Walk through a run

  1. 01

    Choose the request

    Use a preset or edit the request and current graph node.

  2. 02

    Invoke the tool

    Try a mock invocation without credits, or use live Jev classification.

  3. 03

    Read the contract

    Inspect the returned route, policy decision, and structured output for your application.

Try this

Invoke the mock with a read request, then a production change. Compare the returned route and approval requirement.

Execution limits

The LangChain tool is real. It returns a decision and never executes downstream actions.

Explore the example. Check the evidence.
LangChain .invoke()Jev closed-set choicePolicy gateTyped result

Invoke the routing tool

@langchain/core

Both buttons invoke a real LangChain structured tool on the server. Live mode uses Jev; mock mode substitutes seeded predictions. Neither executes a downstream action.

What this integration guarantees
  • Zod validates the request and the two supported routing points.
  • Blocked requests stop before Jev; forbidden nodes never enter the candidate set.
  • Both scores must reach 85%. Low confidence asks for clarification.
  • Configuration changes return an approval requirement, not permission to execute.

Tool response

Tool inputPolicy gateStructured result

A tool result your application can use

Inspect the selected node, policy override and confidence as structured data. The host retains control of execution.

Use it in your TypeScript app

Local integration example · not a published LangChain plugin package

import { createJevRoutingTool } from "./lib/langchain/jev-tool";
import { serverJevTransport } from "./lib/serverJev";

const jevRouter = createJevRoutingTool({
  transport: serverJevTransport,
});

const decision = await jevRouter.invoke({
  request: "Check the current rate limit settings",
  current_node: "ops_agent",
});

// Route only after your host enforces policy and approval.
// decision.executed is always false.
console.log(decision);

Try locally: pnpm example:langchain runs the actual tool through a RunnableLambda chain with mock predictions.

Use live Jev: set TYPESAFE_API_KEY in your server environment or .env.local, then run pnpm example:langchain --live.

The factory is in lib/langchain/jev-tool.ts. Pass it as a tool to your LangChain host or call .invoke() directly. No OpenAI or LangSmith key is required for this example.