Using knowledge stores
A knowledge store is a database your agent uses — Postgres, MySQL, Redis, Qdrant, Neo4j, or Pinecone. You declare it in astropods.yml; the platform creates it and passes the connection details to your agent as environment variables.
This guide builds an agent with a single Postgres store named writer: declare it, run it locally, push a blueprint, and deploy it from the dashboard.
With one store, the variables are POSTGRES_HOST, POSTGRES_PORT, POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB — the entry name (writer) is not part of them. That only changes when you add a second store of the same type (see Adding a second store).
Before you start
You need:
- An Astro AI account.
- The
astCLI. - A container runtime (such as Docker) for
ast project start.
Steps
Declare the store
Add a knowledge block to astropods.yml:
You only set the provider — no host, port, or password. Supported values: postgres, mysql, redis, qdrant, neo4j, and pinecone.
Read the connection in your code
The connection details arrive as environment variables:
Postgres gives you separate fields, not a single URL. Redis, Qdrant, and Neo4j also get a <PREFIX>_URL variable.
Run it locally
The CLI starts a Postgres container next to your agent with the same POSTGRES_* variables wired in. Your data persists across restarts. Logs stream in the foreground; Ctrl+C to stop.
Push a blueprint
The blueprint records that the agent needs a writer Postgres store. It does not contain any credentials.
Deploy from the dashboard
Go to Blueprints, find writer-agent, and click Deploy. In the form:
- Set variables — fill in
ANTHROPIC_API_KEY, either as a value or from your vault. - Choose how the store is backed — each store has a Local / Shared toggle:
- Local (default) — the platform creates a managed Postgres database just for this agent.
- Shared — point the store at a database you’ve connected to the account. One database can back several agents, so they share the same data. Pick it from the dropdown.
- Deploy — submit the form.
To use Shared, connect the database first under Knowledge > Add store (host, port, database, credentials — stored encrypted). Only matching, Ready stores can be selected. See Knowledge stores for connecting a database in a private network.
The agent then appears under Agents with its live status.
Adding a second store
When you have two stores of the same type, the entry name is added to the variables so they don’t clash:
One store is the primary and keeps the plain POSTGRES_* names; the others get the name added. The primary is the entry named after the provider, or — if none is — the first one alphabetically. Here analytics comes first:
Each store is backed on its own, so you can leave one Local and set another to Shared. To make a store the primary, name it after the provider (e.g. postgres:).
Next steps
- Knowledge stores: connect a database to your account and share it across agents
- Managing secrets: store credentials for deployment
- Astropods Spec: full reference for the
knowledgeblock