跳到正文

DOCS

文档

客户端、host SDK、runtime 与 wire 参考。正文跟随源码。

文档

客户端、host SDK、runtime 与 wire 参考。正文跟随源码。

Sveda 文档:入门、JS 客户端、host SDK、sveda-server、stream 协议、MCP 与 tools、模型与 embed token。

STACK BUILDER

Install with an agent

Backend picks the host guide in the prompt. Frontend is for your stack — UI steps live on that host page. If the agent is unsure, it will ask you.

Backend

Frontend

Install Sveda into this project.

Read:
- https://sveda.dev/docs/hosts/laravel
- https://sveda.dev/docs/deploy
- https://sveda.dev/docs/client
- https://sveda.dev/llms.txt

Follow the numbered steps on the host page. If anything about this repo is unclear, ask the user.

Get started

Two pieces: a JS client in the host, a Rust runtime beside it. This page is the shortest path to a live stream.

JS client

SvedaClient is the attach surface. Vue, React, Svelte, Solid, and the web component are optional UI — core does not require them.

Chat UI

Four packages, one shell. Import styles.css, pass endpoints and the embed token, and mount SvedaChat.

Runtime

The binary is sveda-server. It is Axum. It is not in your application request cycle unless you choose to proxy it.

Deploy

Replicas are stateless. Histories and settings live in Postgres. Occupancy, throttle, and MCP creds live in Redis.

Stream protocol

One POST, one SSE response, a closed event list. Frontend vs backend tool.call targets.

MCP & tools

Three layers: builtin agent tools, client-registered frontend tools, and host MCP listed at token mint. Token policy filters tools on every turn.

Tool confirmation

Sensitive tools pause the turn until the chat user taps Confirm or Deny. Opt-in only — nothing runs with confirmation unless the host or client tool declares it.

Models

The catalog is on the runtime. Bring a ChatGPT or Claude key, or any Responses / Anthropic endpoint. DeepSeek is one wrapper. Failover is still the ordered list.

Embed token

Tokens are HMAC, prefixed sveda_embed_, scoped to visitor_id. The host mints them with an optional named policy. The browser only sends them.

Policies

Sveda does not store your users. Your app keeps the role. The embed token carries a policy name. The runtime enforces it.

Appearance

Whatever the host page passes in JS wins. If it passes nothing, the widget uses the appearance block in sveda.yaml. Default is the ink dashed frame.

How the docs are organized

These pages are a contract against the source: package names, route paths, event types, and env vars as they exist in @sveda-ai/core and sveda-server.

PATH

Install and first turn

Get started is the shortest live path: install the client, bind the runtime, mint a token, call session.send.

Connect a host

Numbered install for each language, plus a path with no framework. Same POST /sveda/session JSON on every stack.

Send the first turn.

Install @sveda-ai/core. Run sveda-server on 0.0.0.0:8787. Mint a token. Call session.send.

Get started