Observed since 20 Oct, 18:02 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
TypeScript client for the 10xGraph API server: invoke and stream agent graphs, manage threads, memory and files, run client-side tools, and realtime audio. Formerly @10xscale/agentflow-client.
The TypeScript client for the 10xGraph API server. Build conversational AI applications with streaming responses, realtime audio, client-side tool execution, and dynamic state management.
10xGraph by 10xScale: graph engineering for production AI agents.
Coming from
@10xscale/agentflow-client? This is the same client under its new name. Change the import and you are done; the oldAgentFlow*names still work until 2.0. See Migrating from@10xscale/agentflow-client.
/v1/graph/livenpm install 10xgraph-client
# or
yarn add 10xgraph-client
# or
pnpm add 10xgraph-client
The client versions independently of the Python packages. Pick versions by this table rather than by matching numbers:
10xgraph-client (npm) | API server | Core framework |
|---|---|---|
| 0.6.x | 10xgraph-api >= 0.7.0 | 10xgraph >= 0.10.0 |
@10xscale/agentflow-client 0.5.x | 10xscale-agentflow-cli >= 0.6.0, 10xgraph-api | 10xscale-agentflow >= 0.10.0 |
@10xscale/agentflow-client 0.3-0.4.x | 10xscale-agentflow-cli >= 0.5.0 | 10xscale-agentflow >= 0.9.0 |
The client tracks the API server, which is what it talks to. Client 0.6.x authenticates
WebSockets with the 10xgraph-bearer subprotocol, which 10xgraph-api 0.7.0 introduced. Against
an older 10xscale-agentflow-cli server, HTTP endpoints still work, but wsStream() and
realtime() with bearer auth do not; stay on @10xscale/agentflow-client@0.5.0 until the server
is upgraded.
import { TenxGraphClient, Message } from '10xgraph-client';
const client = new TenxGraphClient({
baseUrl: 'http://localhost:8000',
authToken: 'your-token', // optional bearer auth
debug: true, // optional
});
const result = await client.invoke([Message.text_message('Hello, how can you help me?', 'user')]);
console.log(result.messages);
Start a local server with 10xgraph api (from the 10xgraph-api package).
import { TenxGraphClient, basicAuth, headerAuth } from '10xgraph-client';
const bearerClient = new TenxGraphClient({
baseUrl: 'https://api.example.com',
authToken: process.env.TENXGRAPH_TOKEN,
});
const basicClient = new TenxGraphClient({
baseUrl: 'https://api.example.com',
auth: basicAuth('service-user', 'service-password'),
});
const apiKeyClient = new TenxGraphClient({
baseUrl: 'https://api.example.com',
auth: headerAuth('X-API-Key', process.env.TENXGRAPH_API_KEY!),
});
const sessionClient = new TenxGraphClient({
baseUrl: 'https://api.example.com',
credentials: 'include',
});
const stream = client.stream([Message.text_message('Tell me a story', 'user')]);
for await (const chunk of stream) {
if (chunk.event === 'message') {
console.log(chunk.message?.content);
}
}
/v1/graph/live)Transport-only: you stream PCM16 in and get PCM16 out. Mic capture and playback are yours to wire.
import { TenxGraphClient } from '10xgraph-client';
const client = new TenxGraphClient({ baseUrl: 'http://localhost:8000', authToken });
const session = client.realtime(
{ model: 'gemini-2.5-flash-live', modalities: 'AUDIO' },
{ reconnect: { maxAttempts: 5 } }
);
session.on('audio', (pcm16, sampleRate) => playback(pcm16, sampleRate)); // PCM16 @ 24 kHz
session.on('output_transcript', (e) => console.log(e.text));
session.on('tool_call', (e) => console.log('tool', e.name, e.args));
session.on('error', (e) => console.error(e.message));
await session.ready; // socket open + init sent
session.sendAudio(micChunk); // PCM16 @ 16 kHz (Uint8Array | ArrayBuffer)
// push-to-talk: session.activityStart() / session.activityEnd()
session.close(); // graceful end; disables reconnect
Auth uses the browser-safe 10xgraph-bearer subprotocol automatically. In Node < 21 (no global
WebSocket), pass an implementation:
import WebSocket from 'ws';
const client = new TenxGraphClient({ baseUrl, authToken, webSocketImpl: WebSocket });
const upload = await client.uploadFile(file);
// Best URL for rendering/downloading in the UI.
// Cloud-backed deployments typically return a signed URL here.
const accessUrl = upload.data.direct_url ?? upload.data.url;
const fileInfo = await client.getFileInfo(upload.data.file_id);
const fileUrl = await client.getFileAccessUrl(upload.data.file_id);
const msg = Message.withFile('Summarize this document', upload.data.file_id, upload.data.mime_type);
Important: remote tools (registered client-side) should only be used for browser-level APIs
like localStorage or navigator.geolocation. For most operations (database queries, external API
calls, calculations), define your tools in the Python backend instead. See
Remote tools for details.
// Matching trusted schema must be declared in the server's 10xgraph.json.
client.registerToolHandler('get_weather', async ({ location }) => {
return { temperature: 72, conditions: 'sunny' };
});
// Tools execute automatically during invoke
const result = await client.invoke([Message.text_message('What is the weather in NYC?', 'user')]);
Declare model-facing metadata in the server's 10xgraph.json, never from an untrusted client:
{
"remote_tools": [
{
"node": "assistant",
"name": "get_weather",
"description": "Get current weather for a location",
"parameters": {
"type": "object",
"properties": { "location": { "type": "string" } },
"required": ["location"]
}
}
]
}
No client setup call is required or available.
Full documentation lives at 10xgraph.com/docs.
/v1/graph/live sessionTenxGraphClient: constructor config and every methodMessage and content blocksinvoke(): batch processingExecute the agent with an automatic tool execution loop:
const result = await client.invoke(messages, {
recursion_limit: 25,
response_granularity: 'full',
});
stream(): real-time streamingconst stream = client.stream(messages);
for await (const chunk of stream) {
// Process chunks in real-time
}
graphStateSchema(): dynamic schemaGet the agent state schema for form generation and validation:
const schema = await client.graphStateSchema();
graphTools(): tool inventoryList the tools the graph's tool nodes expose, grouped by node. Each tool is tagged with its
source (local, mcp, or remote):
const { data } = await client.graphTools();
// data.nodes[].tools[] -> { name, description, source, parameters }
observability(threadId, runId?): run tracesFetch the reconstructed trace for a run (spans, events, and cost). Defaults to the thread's latest run:
const trace = await client.observability(threadId);
const specific = await client.observability(threadId, runId);
The examples/ directory has complete working examples:
┌──────────────────────┐
│ Your application │
└──────────┬───────────┘
│ TenxGraphClient
▼
┌──────────────────────┐
│ 10xgraph-client │ <- this library
│ client, tools, │
│ messages │
└──────────┬───────────┘
│ HTTP/HTTPS + WebSocket
▼
┌──────────────────────┐
│ 10xgraph-api │ <- your backend
│ (10xgraph api) │
└──────────────────────┘
const client = new TenxGraphClient({
baseUrl: string, // Required: API base URL
authToken?: string, // Optional: bearer token
auth?: TenxGraphAuth, // Optional: bearer/basic/custom header auth
headers?: HeadersInit, // Optional: extra headers for every request
credentials?: RequestCredentials, // Optional: cookie/session auth
timeout?: number, // Optional: request timeout (default: 5 min)
debug?: boolean, // Optional: enable debug logging
webSocketImpl?: typeof WebSocket // Node < 21 (pass the 'ws' package)
});
@10xscale/agentflow-clientThe project was renamed from Agentflow to 10xGraph because "Agentflow" is shared by several unrelated projects and was hard to find. The client, license and maintainers are the same.
| Before | After |
|---|---|
npm install @10xscale/agentflow-client | npm install 10xgraph-client |
AgentFlowClient, AgentFlowConfig | TenxGraphClient, TenxGraphConfig |
AgentFlowError | TenxGraphError |
AgentFlowAuth (+ Bearer/Basic/Header variants) | TenxGraphAuth (+ same variants) |
WS subprotocol agentflow-bearer | 10xgraph-bearer |
Server 10xscale-agentflow-cli, agentflow.json | 10xgraph-api, 10xgraph.json |
Steps:
npm uninstall @10xscale/agentflow-client && npm install 10xgraph-client'@10xscale/agentflow-client' with '10xgraph-client' in your imports.10xgraph-api >= 0.7.0 if you use wsStream() or realtime().AgentFlow* identifiers to TenxGraph*. The old names are exported as
deprecated aliases of the same classes and types, so instanceof AgentFlowError keeps working.
They are removed in 2.0.One observable difference: errors now report error.name === 'TenxGraphError' instead of
'AgentFlowError'. Use instanceof rather than comparing names.
Ships dual ESM + CJS with types. import resolves dist/index.js (ESM); require resolves
dist/index.cjs. Tree-shakeable ("sideEffects": false).
npm test # watch mode
npm run test:run # run once
npm run build # build the library
import type {
TenxGraphClient,
Message,
ToolRegistration,
InvokeResult,
StreamChunk,
AgentState,
AgentStateSchema,
} from '10xgraph-client';
Be the first community contributor on this wall.
So far only the lead maintainer has committed here, so the first community spot is open. Merge one pull request and your avatar is the next one on this wall and on the contributor page at 10xgraph.com/maintainers. This client is how frontends talk to production agents, so the work is used from day one.
Your first pull request can be small. These are real, self-contained, and useful today:
examples/ has plain TypeScript and React. Vue, Svelte, Next.js and Node scripts are all missing.From clone to a passing check (Node 18 or newer):
git clone https://github.com/10xGraph/10xgraph-client.git
cd 10xgraph-client
npm ci
npm run check # lint, typecheck and tests: the same gate as CI
Draft pull requests are welcome, so open early and ask questions in the PR. For bigger changes, start a thread in the core repository's Discussions first. CONTRIBUTING.md has every check and the release notes rules.
10xGraph is MIT licensed and made by 10xScale. Contributions are accepted under the same license.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.6.0Registry latest | 10 Oct 2026 | 12 | |
| 0.0.0-stage | 10 Oct 2026 | 0 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 18:02 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:6d1f102cde703ba8d97404e5843a176517afeb280ab44a77e1d6fee4a49fc0db