docs: fix import and export names in code samples

TH
17d ago
+21-19

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.md and netlify-functions.md use PostgresMemoryAdapter and PostgresVectorAdapter with a connectionString option. @voltagent/postgres exports PostgreSQLMemoryAdapter and PostgreSQLVectorAdapter, and both take connection.

  • website/docs/agents/memory/postgres.md uses PostgresVectorAdapter in two samples, the full memory setup and the configuration options example.

  • website/docs/workflows/overview.md uses PostgresStorage, which doesn't exist, while the workflow memory option actually takes a Memory instance.

  • website/observability/setup.md imports serverlessHono from @voltagent/core and honoServer from @voltagent/server. That package doesn't exist, honoServer isn't used in the sample, and serverlessHono lives in @voltagent/serverless-hono. The sample also uses VoltOpsClient without importing it.

  • website/recipes/mcp.md imports MCPServer from @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 PostgresMemoryAdapter and PostgresVectorAdapter to PostgreSQLMemoryAdapter and PostgreSQLVectorAdapter, and uses the connection option instead of connectionString.
  • Wraps the Postgres adapter in new Memory({ storage }) in the workflow sample, replacing the nonexistent PostgresStorage.
  • Corrects the observability sample to import serverlessHono from @voltagent/serverless-hono and adds the missing VoltOpsClient import.
  • Imports MCPServer from @voltagent/mcp-server instead 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.