Veldra — 让代理人诞生,然后看着它成长。一个可自行部署、以本地为先的代理人平台:用通俗的语言描述您需要的功能,它就会编译
Veldra — 让代理人诞生,然后看着它成长。一个可自行部署、以本地为先的代理人平台:用通俗的语言描述您需要的功能,它就会编译
The one load-bearing idea: an agent is data, not code — a versioned
AgentSpecrow in Postgres. "Build me an agent" = compile natural language → validatedAgentSpec. "Change it" = a JSON-Patch you approve. The runtime is a pure interpreter of that spec.
page / section / char-span.| Home — smart composer, KPI strip, agent board | All agents — gallery, tags, chat / builder |
| Plugins — MCP connectors + template gallery | Install wizard — first-run setup |
…Everything is one FastAPI process (edge + orchestrator + runtime + RAG) plus the Vue
SPA. An agent is a stable agents row + an append-only stack of immutable
AgentSpec versions; the runtime is a pure interpreter of the current version.
Prereqs: Docker (and, for the local-first default, Ollama).
One command checks prereqs, pulls the local models, creates .env, brings up the whole
stack (Postgres+pgvector, Redis, MinIO, and the app), and waits for it to be healthy:
make quickstartThen open http://localhost:8000 → the install wizard walks you through it: name
your workspace, test the provider connection, and create your admin account. Sign in and
start building. make down stops everything, make logs tails the app.
Prefer to do it by hand?
ollama pull qwen3.5:0.8b # agent model (tools + thinking)
ollama pull nomic-embed-text # embeddings (768-dim)
make up # = docker compose -f deploy/docker-compose.yml up --build -dPrereqs: also uv + Node 20.19+.
cp example.env .env
make dev # infra in Docker + migrate; prints the run commands
uv run uvicorn veldra_app.main:app --reload # API on :8000
cd apps/web && npm install && npm run dev # UI on :5173 (proxies /api → :8000)Then describe what you want (e.g. "answer questions from these docs and always cite
the page") — Veldra builds the agent and you chat with it. Or use the CLI (set
VELDRA_AUTH_ENABLED=false for local, or VELDRA_SERVICE_TOKEN):
uv run veldra kb add ./whitepaper.pdf
uv run veldra build "answer from my docs with citations"
uv run veldra ask "what does section 3 say about pricing?"| Build this | How |
|---|---|
| A single agent | Type a task or a description — the orchestrator writes the policy, picks tools/skills/KB and a thinking method. |
| A whole team | "Build a team to run an online store" → a coordinator + specialists, wired via sub_agents. |
| Tool-using agents | Grant built-ins (kb.search, calc.eval, web.scrape, http.fetch, time.now, fs.*, json.query, regex.extract) or plugin tools from connected MCP servers. |
| Connected agents | Install MCP connectors (Shopify, Alibaba, or any HTTP/SSE/stdio server); their tools appear in the catalog and the orchestrator can grant them. |
| RAG agents | Attach an editable knowledge base; answers cite page / section. |
| Workflows | A typed workflow_graph the runtime executes — author by asking or on the visual canvas. |
| Self-improving agents | Turn on auto-improve; feedback → reflection → a stored lesson injected next time. |
Built-in tools are always available. To give agents new powers, an admin opens Plugins → Add connector and picks a template:
| Connector | Transport | Configure |
|---|---|---|
| Shopify | Streamable HTTP | server URL + access token |
| Alibaba | Streamable HTTP | MCP endpoint + API key |
| Custom HTTP / SSE | HTTP / SSE | any MCP server URL (+ optional headers) |
| Local (stdio) | stdio | a command to run, e.g. npx -y some-mcp-server |
Credentials are stored server-side and never returned to the browser. Test
connection lists the server's tools; once enabled, they appear as . in
the catalog. A connector tool set to permission_mode: ask requires explicit approval
before it runs.
The LLM layer is provider-pluggable via VELDRA_LLM_PROVIDER:
| Provider | value | Notes |
|---|---|---|
| Ollama (default) | ollama |
Fully local, no key. VELDRA_OLLAMA_MODEL (+ optional VELDRA_OLLAMA_ORCHESTRATOR_MODEL). |
| OpenAI-compatible | openai |
OpenAI, Groq, OpenRouter, vLLM, LM Studio — set VELDRA_OPENAI_BASE_URL, OPENAI_API_KEY, VELDRA_OPENAI_MODEL. |
| Anthropic | anthropic |
Claude with adaptive thinking + effort. Needs ANTHROPIC_API_KEY. |
Embeddings are independently pluggable (VELDRA_EMBED_PROVIDER): local Ollama
nomic-embed-text (768-dim) by default, or OpenAI text-embedding-3-small (1536). The
dimension is fixed at first migration.
VELDRA_AGENT_MODE)To stay reliable even on sub-1B local models, auto runs a constrained decision
loop for local/small models instead of fragile native tool-calling: each step the
model picks an action from an enum and fills exactly that tool's args via structured
output (goal-aware prompting, required-field fallback, a no-progress breaker, bounded
repair, graceful step-limit fallback). The final answer is a separate, streamed,
grounded composition. Claude/large models keep native tool-calling. Force either with
VELDRA_AGENT_MODE=decision|native. A repeatable suite (python -m evals.decision_loop.run)
asserts, on qwen3.5:0.8b: 100% answered, 0 hallucinated tools, each tool called
once with non-empty args, and RAG answers cited.
Multi-user, single workspace. First run shows the install wizard; thereafter a sign-in gate. Sessions are opaque bearer tokens (stored only as a SHA-256 hash, revocable + expiring); passwords use PBKDF2-SHA256 (stdlib, no native deps). Roles:
Set VELDRA_AUTH_ENABLED=false to resolve every request to the default workspace as a
system admin (CLI, evals, trusted local single-user dev). See example.env.
apps/web/ Vue 3 + Vite + Pinia + TS — the workspace front-end
services/app/ one FastAPI process: edge (REST+SSE) · auth · orchestrator · runtime · rag
packages/ spec-schema · llm-providers · mcp-client · mcp-servers · thinking-methods
cli/ thin Typer client (veldra kb add | build | ask | agents | selfmod)
deploy/ docker-compose (postgres+pgvector, redis, minio) + Alembic migrations
evals/ nl_to_spec golden accuracy · decision_loop reliability suite
docs/ ARCHITECTURE.md + screenshots/| Symptom | Fix |
|---|---|
| App can't reach Ollama from Docker | The container reaches your host at host.docker.internal; make sure Ollama is running and the models are pulled. |
port 5432 already in use |
The Postgres container maps host port 5433 (to avoid clashing with a local Postgres). The app talks to it on the Docker network. |
| Embedding dimension mismatch | VELDRA_EMBED_DIM is fixed at first migration. Use an embedder of the same dimension, or re-index (or use Qdrant for mixed dims). |
| Stuck on the install wizard | It only shows when no users exist and VELDRA_AUTH_ENABLED=true. To bypass auth entirely, set it to false. |
| CLI gets 401 | With auth on, set VELDRA_AUTH_ENABLED=false for local use, or send VELDRA_SERVICE_TOKEN as a bearer token. |
| A connector shows "error" | Open Plugins, hit Test — the error from the MCP server is shown. Check the URL, credentials, and that the server is reachable. |
See docs/ARCHITECTURE.md for the full design, the provider
interface, and the roadmap. The previous Django GPT-3.5 chatbot is preserved on the
archive/v1-django tag.
暂无开放 Issues,或尚未同步最近议题。