# How ViteHub works

ViteHub connects your server code to your host's resources. You choose features in your configuration and call their server APIs. The build prepares the routes, bindings, and files your host needs.

## Server features belong to your application

A Server Primitive is an API for one server feature, like KV, Database, Blob, or Queue. Call it directly from a route without needing an Agent.

For example, a settings route reads a value with `kv.get()`. Locally, KV can use a local store. On Cloudflare, the same route can use a Workers KV binding. Your configuration selects the provider, and the import stays the same. Provider limits still apply, and each package lists them on its host and error pages.

Try this in [your first Server Primitive](https://vitehub.dev/docs/getting-started/first-server-primitive).

## Definitions give state and work a name

Some features need a Definition file. A Queue Definition declares a background job handler. An Agent Definition declares what an Agent can do. ViteHub finds these files and names them by path.

Your code calls the named feature rather than generated provider files. Read [Definition discovery](https://vitehub.dev/docs/development/definition-discovery) when you add a Definition or check its name.

## Agents use the same server features

An Agent is a named actor that runs instructions through a model, a coding provider, or your code. An Invocation is one run of that Agent.

A Capability gives an Agent one selected operation. A KV Capability can let a support Agent read settings while your app still calls KV directly. Add only the operations the Agent needs. Your server decides who can invoke it and which resources it can access.

Follow [your first Agent](https://vitehub.dev/docs/getting-started/first-agent), then read [Capabilities](https://vitehub.dev/docs/agents/capabilities) and [Invocations](https://vitehub.dev/docs/agents/invocations) as you add behavior.

## Choose the next page by your task

Each product has a tutorial, task guides, and an API reference. Deeper topics live with the feature that owns them:

- [Workspaces and Sources](https://vitehub.dev/docs/workspace/concepts) cover writable files and read-only mounts.
- [Invoker identity](https://vitehub.dev/docs/agents/invokers) covers the trusted caller of an Agent run.
- [Runtime policy](https://vitehub.dev/docs/agents/runtime-policy) covers approval decisions and recorded events.
- [Frameworks and hosts](https://vitehub.dev/docs/frameworks-hosts) covers deployment configuration.

Browse [Learn](https://vitehub.dev/learn) to pick a result to build, or use the [documentation catalog](https://vitehub.dev/docs) to find an API.

<!-- vitehub-docs:section-links -->
## In this section

- [Get started](https://vitehub.dev/raw/docs/getting-started.md)
- Next steps
  - [Server Primitives](https://vitehub.dev/raw/docs/getting-started/server-primitives.md)
  - [How ViteHub works](https://vitehub.dev/raw/docs/getting-started/concepts.md) (this page)
- [Build and deploy](https://vitehub.dev/raw/docs/getting-started/build-and-deploy.md)
- [Coding agents](https://vitehub.dev/raw/docs/getting-started/ai-resources.md)

Next: [Build and deploy](https://vitehub.dev/raw/docs/getting-started/build-and-deploy.md)

All pages: [llms.txt](https://vitehub.dev/llms.txt)
