# Synsema docs (0.6.x, en) > Versioned, doctested documentation for Synsema. Every page is also available as raw Markdown: append `.md` to any URL (e.g. https://docs.synsema.com/en/0.6.x/21-secrets.md). - [Quickstart](https://docs.synsema.com/en/0.6.x/00-quickstart.md): Synsema is a programming language designed for AI agents. Install it and run your first program, HTTP server and LLM call in minutes — a single static binary, no runtime. - [Counter your priors](https://docs.synsema.com/en/0.6.x/01-counter-your-priors.md): The places where Synsema differs from what an LLM (or a developer) assumes by default — each one verified against the engine. - [Python → Synsema](https://docs.synsema.com/en/0.6.x/01a-python-to-synsema.md): The translation table — write Synsema by translating the Python you already know, with every semantic divergence flagged and doctested. - [Syntax](https://docs.synsema.com/en/0.6.x/10-syntax.md): Synsema syntax — variables with let/set, operators, the unary pipe, inline conditionals, strings, and indentation blocks. - [Types & data](https://docs.synsema.com/en/0.6.x/11-types.md): Synsema values, property access (of / dot / index), custom types, and the intentional operations that replace loops. - [Tasks & lambdas](https://docs.synsema.com/en/0.6.x/12-tasks-lambdas.md): Define tasks with give, default and named arguments, recursion, and first-class lambdas passed to higher-order operations. - [Control flow & errors](https://docs.synsema.com/en/0.6.x/13-control-errors.md): when/otherwise, match patterns, each and while loops, and error handling with try/recover/raise. - [Modules (use / export)](https://docs.synsema.com/en/0.6.x/14-modules.md): Split Synsema across files with use and export — a module is a map of its exports, imported under an alias; export routes lets a serve mount whole route groups. - [Capabilities & intent](https://docs.synsema.com/en/0.6.x/20-capabilities.md): Synsema is deny-by-default — nothing reaches the network, filesystem, database or secrets unless you declare the capability with require. Scopes, sandbox, and intent. - [Secrets](https://docs.synsema.com/en/0.6.x/21-secrets.md): Use API keys, tokens and webhook secrets in Synsema without ever exposing them — secret, as_secret, bearer, hmac and the scoped reveal. - [Sandboxing untrusted code](https://docs.synsema.com/en/0.6.x/22-sandbox.md): Run code you don't trust — LLM-generated, a user's plugin, a public playground — safely in Synsema, with the sandbox block and the host capability ceiling. - [Files & I/O](https://docs.synsema.com/en/0.6.x/30-io-files.md): Read, write, search and navigate the filesystem in Synsema — atomic writes, line ranges, list_dir, grep — all gated by the file capability. - [Time & random](https://docs.synsema.com/en/0.6.x/31-time-random.md): Timestamps and formatting (now, format_time, parse_time) and randomness (random, random_int) — note that random is deny-by-default. - [HTTP client](https://docs.synsema.com/en/0.6.x/32-http-client.md): Make HTTP requests in Synsema — http/http_get/post/put/delete and fetch — all gated by net(host), with a uniform response map. - [SQL, Mongo & Redis](https://docs.synsema.com/en/0.6.x/33-sql-mongo-redis.md): One universal db API over SQLite/Postgres/MySQL, plus mongo_* (documents) and redis_* (key-value) — all pure-Rust, all gated by the db capability. - [Search your data](https://docs.synsema.com/en/0.6.x/33a-search.md): Full-text search with SQLite FTS5/BM25 (pure SQL, today), vector search with an embedder-as-a-task, and hybrid ranking with RRF — no new features, no external services. - [Cron](https://docs.synsema.com/en/0.6.x/34-cron.md): Schedule background tasks in Synsema with cron_every and cron_after, manage them with cron_cancel/cron_list, and keep them alive with serve. - [Bytes, math & arrays](https://docs.synsema.com/en/0.6.x/35-bytes-math-arrays.md): Binary data (bytes/decode, hashing), math operators and constants, decimal/complex, and numeric arrays with linear algebra (dot, norm, matmul). - [JSON](https://docs.synsema.com/en/0.6.x/36-json.md): Serialize and parse JSON in Synsema with json_encode / json_decode — round-trippable, with safe handling of secrets, bytes and decimal. - [CSV, stats & charts](https://docs.synsema.com/en/0.6.x/37-dataviz.md): CSV import/export (RFC 4180), descriptive statistics (median, percentile, histogram), native server-side SVG charts — including charts agents can read as data — and PNG/PDF export. - [Blockchain (read → build → sign → send → confirm)](https://docs.synsema.com/en/0.6.x/38-blockchain.md): Operate on-chain from an agent — the full loop on Ethereum, Solana and Algorand — read the chain (nonce, fees, balances, eth_call, suggested params), build the tx (tx_eip1559), sign it, broadcast it and wait for confirmation, plus EVM contract calls (ABI), dApp signatures (EIP-191/712), SPL tokens and HD custody (BIP-39/32, SLIP-0010, keystore V3) — with the private key sealed as a secret that never materializes, signing and custody deny-by-default and audited. All pure-Rust, single binary. - [Bitcoin (the UTXO matrix — read → build → sign → send → confirm)](https://docs.synsema.com/en/0.6.x/38a-bitcoin.md): Operate on Bitcoin from an agent with the same structural safety as the rest of the stack — addresses and scripts (P2WPKH/P2TR/P2PKH, strict bech32/bech32m), the btc_tx builder where every satoshi is accounted for (UTXO's implicit fee becomes impossible to forget), BIP-340 Schnorr taproot signing behind the SAME `sign` gate, the Esplora read side (utxos, balance, fees, broadcast, bounded confirmation), Bitcoin Core via btc_rpc, and PSBT (BIP-174) for cold custody: the agent PREPARES the transaction, a human signs it on their hardware wallet. The private key sealed as a secret that never materializes. All pure-Rust, one binary. - [WebSocket client](https://docs.synsema.com/en/0.6.x/39-websocket.md): A first-class WebSocket client for live feeds — RPC subscriptions, exchange streams, chat, mempool. ws_select multiplexes thousands of feeds in one thread (readiness-driven, ~0 CPU idle), reconnection with backoff + resubscribe, keepalive/half-open detection, backpressure, and parallel_map fan-out. Gated by the same net(host) capability as HTTP. Pure-Rust, single binary. - [HTTP server](https://docs.synsema.com/en/0.6.x/40-serve.md): Synsema's built-in production HTTP server — routes, path params, declarative auth and validation, pagination, SSE, rate limiting, static files, CORS, and automatic HTTPS. - [Login & sessions (web auth)](https://docs.synsema.com/en/0.6.x/40a-web-auth.md): Everything a browser login needs — session cookies with safe defaults, password hashing (argon2id), signed tokens (JWT HS256), 2FA TOTP, CSRF and a gated CSPRNG. - [Build a REST API](https://docs.synsema.com/en/0.6.x/43-build-api.md): A complete CRUD REST API in Synsema — routes, declarative auth and validation, pagination, a real database — in one file, in fewer lines than FastAPI, with the production server built in. - [Your DB as a REST API](https://docs.synsema.com/en/0.6.x/44-db-api.md): Expose a database as a generic REST API by introspection — sql_tables() + a whitelist, roles, and row-level security as one lambda per table. A pattern, today, with no new features. - [Agent identity & auth](https://docs.synsema.com/en/0.6.x/46-agent-identity.md): Agents as first-class subjects — capability tokens that can only narrow, signed requests, third-party OIDC, mTLS, and quotas metered per agent identity instead of per IP. - [Frontend](https://docs.synsema.com/en/0.6.x/41-frontend.md): Server-side HTML in Synsema — render() templates with verbatim CSS/JS blocks, components with props, named slots, safe script data, content() for agents, and static assets with cache policy. - [Build a website](https://docs.synsema.com/en/0.6.x/41a-build-a-website.md): A complete, styled website in Synsema — layout, components with props, inline CSS with transitions, a classic form, custom error pages, and routes split into a module — no framework, one binary. - [MCP servers](https://docs.synsema.com/en/0.6.x/42-mcp.md): Build MCP (Model Context Protocol) servers in Synsema — expose tools, data and existing APIs to any AI agent (Claude, Cursor…) over JSON-RPC, safely sandboxed. - [Your DB as MCP tools](https://docs.synsema.com/en/0.6.x/45-db-mcp.md): Expose the same whitelisted, RLS-filtered database to AI agents as MCP tools — one pure JSON-RPC task, the user threaded explicitly into every call. - [LLM primitives](https://docs.synsema.com/en/0.6.x/50-llm-primitives.md): The LLM is a built-in primitive in Synsema — reason, decide, analyze, generate, plus llm_stream for token-by-token streaming — with validated decisions, an offline mode, and the llm capability. - [Tool calling](https://docs.synsema.com/en/0.6.x/51-llm-tool-calling.md): Let the model pick a tool safely with llm_step + call_tool — an in-language loop with an allow-list, per-tool least-privilege, frozen intent, and a bounded budget. - [Provider config](https://docs.synsema.com/en/0.6.x/52-llm-provider-native.md): Configure the LLM provider for Synsema — Anthropic, OpenAI, MiniMax, DeepSeek, any OpenAI-compatible local server, or an embedded GGUF running inside the process — via .env, with the key never exposed to the program. - [Provider API directly](https://docs.synsema.com/en/0.6.x/53-llm-api-direct.md): When you need full control, call the provider's HTTP API yourself with http_post + secret/bearer — gated by net(host), credentials never exposed. - [Multi-agent](https://docs.synsema.com/en/0.6.x/60-agents.md): Concurrent agents in Synsema coordinate through a thread-safe blackboard and signals — real threads, isolated interpreters, contained failures. - [Memory & state](https://docs.synsema.com/en/0.6.x/61-memory.md): Declared persistent agent memory (require memory + remember/recall), per-agent namespaces, crash-resumable progress, owner rules, and per-request serve state. - [Human-in-the-loop](https://docs.synsema.com/en/0.6.x/62-human.md): Approval gates, confirmations, questions and previews are language primitives in Synsema — waiting for a real human in the terminal, denying fail-closed where no human exists, and queueing with one-time tokens under serve. - [Observability](https://docs.synsema.com/en/0.6.x/63-observability.md): Logging with log, decorative trace/measure/checkpoint markers, crash-resume via progress, and rich opt-in error diagnostics with --explain. - [CLI](https://docs.synsema.com/en/0.6.x/70-cli.md): The Synsema command-line — run, test, check, serve, conform, repl, daemon — plus the flags and exit codes that make it script- and CI-friendly. - [Deploy](https://docs.synsema.com/en/0.6.x/71-deploy.md): Deploy Synsema as a single static binary — daemon vs systemd, automatic HTTPS via CLI flags, Docker and Kubernetes — with a dev-clean .syn that needs no edits for prod. - [WebAssembly](https://docs.synsema.com/en/0.6.x/72-wasm.md): Synsema as WebAssembly — the wasip1 artifact for confidential jobs, TEEs and wasmtime, and the embeddable artifact for browsers, Node/Bun, Python, Go and edge runtimes, where your app lends the program http/kv/llm under the same deny-by-default capability model. - [Cookbook](https://docs.synsema.com/en/0.6.x/80-cookbook.md): Copy-paste Synsema patterns — input validation with partial results, plus pointers to the full patterns (HTTP API, CRUD, LLM op, agent tools, secrets). - [Builtins index](https://docs.synsema.com/en/0.6.x/90-builtins.md): A categorized index of Synsema's built-in functions — collections, text, math, bytes, time, JSON, I/O, HTTP, DB, memory and response helpers. - [Capabilities index](https://docs.synsema.com/en/0.6.x/91-capabilities-ref.md): Every Synsema capability, what it gates, how it's scoped, and which ones are auto-granted under run. - [Errors & exit codes](https://docs.synsema.com/en/0.6.x/92-errors.md): How errors work in Synsema — raise, try/recover, the rich --explain report, error classification, and the exit codes used by run/test/check.