docs: fix import and export names in code samples
PR Checklist
- The commit message follows our guidelines
Bugs / Features
- Related issue(s) linked (no issue, docs only)
- Tests for the changes have been added (docs only)
- Docs have been added / updated
- Changesets have been added (no package changes)
What is the current behavior?
Some code samples in the docs import names that the packages don't export, so they fail to compile when copied.
-
website/deployment-docs/cloudflare-workers.mdandnetlify-functions.mdusePostgresMemoryAdapterandPostgresVectorAdapterwith aconnectionStringoption.@voltagent/postgresexportsPostgreSQLMemoryAdapterandPostgreSQLVectorAdapter, and both takeconnection. -
website/docs/agents/memory/postgres.mdusesPostgresVectorAdapterin two samples, the full memory setup and the configuration options example. -
website/docs/workflows/overview.mdusesPostgresStorage, which doesn't exist, while the workflowmemoryoption actually takes aMemoryinstance. -
website/observability/setup.mdimportsserverlessHonofrom@voltagent/coreandhonoServerfrom@voltagent/server. That package doesn't exist,honoServerisn't used in the sample, andserverlessHonolives in@voltagent/serverless-hono. The sample also usesVoltOpsClientwithout importing it. -
website/recipes/mcp.mdimportsMCPServerfrom@voltagent/core, but that class is exported by@voltagent/mcp-server.
What is the new behavior?
Each sample now imports names that exist, and the Postgres samples use connection. The workflow sample wraps the adapter in new Memory({ storage }), the same pattern the JSDoc in packages/core/src/workflow/chain.ts shows.
Notes for reviewers
I checked every name against packages/*/src on main.
I also type-checked the old and new snippets with tsc against the published @voltagent/core 2.11.0, @voltagent/postgres 2.1.3, @voltagent/mcp-server 2.2.0 and @voltagent/serverless-hono 2.0.12 (the versions on main). The old imports give 6 errors (missing exports and a missing module), while the new snippets compile cleanly.
Prettier passes on the changed files. I didn't build the Docusaurus site.
I used Claude Code to find the mismatches and draft the edits. I reviewed each change and ran the checks above myself.
Summary by cubic
Fixes documentation code samples so the imports actually exist in their packages and the snippets compile when copied.
- Renames
PostgresMemoryAdapterandPostgresVectorAdaptertoPostgreSQLMemoryAdapterandPostgreSQLVectorAdapter, and uses theconnectionoption instead ofconnectionString. - Wraps the Postgres adapter in
new Memory({ storage })in the workflow sample, replacing the nonexistentPostgresStorage. - Corrects the observability sample to import
serverlessHonofrom@voltagent/serverless-honoand adds the missingVoltOpsClientimport. - Imports
MCPServerfrom@voltagent/mcp-serverinstead of@voltagent/core.
Summary by CodeRabbit
- Documentation
- Updated PostgreSQL examples across deployment, memory, and workflow guides to use the current adapter names and connection option.
- Revised workflow-history guidance to show PostgreSQL memory configuration.
- Updated serverless runtime and MCP server examples to use their current package imports.