Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 41 additions & 6 deletions docs/en/docs/get-started/agent-install.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ From the results, decide:
- **Where the Gateway can run:** native packages cover Linux x86_64 or arm64 with glibc 2.28 or later, and macOS 15 or later on Intel or Apple Silicon. Native Windows and musl systems such as Alpine cannot run these packages. For local Gateway deployment on Windows, follow the [WSL2 instructions](../operate/install-gateway.md#windows), running Core and the provider CLI in that Linux environment; distribution CI does not cover WSL2 host integration. A compatible Windows client can instead connect to a remote Gateway: follow its host guide for the URL, key, and protocol requirements. Without a Gateway, use the [plugin path](#3b-plugin-path).
- **Installed Agents:** use detected commands as suggestions in step 2. Honor the user's named host even when its CLI is absent from `PATH`: it may be a desktop app, use a custom launcher, or run on another machine. An absent command does not mean the host is unsupported. Ask only for the target or launcher you cannot establish from the environment.
- **Codex credentials:** use `CODEX_HOME`, falling back to the current environment's user home plus `.codex`. A present `auth.json` only establishes that a credential file exists, not that a subscription is usable. Codex can also use the OS credential store, so a missing file does not prove it is signed out. The subscription path below requires file credentials accessible to Core and the Gateway. Ask the user to confirm ChatGPT login with `codex login status` in that environment's own terminal and report only the authentication mode and success, not the raw output. Do not read or copy the credential file or change its storage mode automatically. A file on the Windows client does not establish credentials for WSL2 or a remote Gateway. See [Codex credential storage](https://learn.chatgpt.com/docs/auth#credential-storage).
- **Existing installation:** when PowerContext is already installed, tell the user the version and ask whether to upgrade or keep it before continuing. When the user's Agent already has the PowerContext plugin, note it for step 3a.
- **Default storage:** use embedded seekdb for new local deployments. Current `pylibseekdb` wheels support Linux x86_64 or arm64 with glibc 2.28 or later, and macOS 15 or later on Intel or Apple Silicon; they must also match the Server's Python runtime. Use SQLite on native Windows, musl systems, older systems, or other environments without a compatible wheel, and explain the reason to the user. Assess WSL2 as its Linux environment, not its Windows host. Network, index, or download failures do not establish an unsupported platform and must not trigger an automatic fallback to SQLite.
- **Existing installation:** when PowerContext is already installed, tell the user the version and ask whether to upgrade or keep it before continuing. Preserve its storage backend, data location, and database name; the default applies only to new deployments, and changing backends does not migrate data. When the user's Agent already has the PowerContext plugin, note it for step 3a.

Use the host's installation guide and setup target below. Command names and setup targets can differ:

Expand Down Expand Up @@ -100,7 +101,27 @@ curl -fsSL https://powercontext.oceanbase.io/install.sh | bash -s -- --gateway

Run the `export PATH=...` command that the installer prints at the end.

**Check:** `powercontext --version` and `pc-gateway --version` report the same version.
### Install seekdb dependencies

For a new seekdb deployment, complete this step after the base installer and before running the configuration wizard or starting the Server. The plugin and single-host team paths use this step too. Skip it for SQLite or OceanBase.

Read `powercontext --version` and keep that PowerContext version. **For PowerContext 1.6.1**, explicitly install the verified binding:

```bash
uv tool install --force --with "pylibseekdb==1.4.0.post2" "powercontext[cli,server,seekdb]==1.6.1"
```

The published 1.6.1 extra allows `pylibseekdb>=1.4.0.post2,<2`, which can select the failing 1.4.1.post2 combination reported in [#2985](https://github.com/oceanbase/powercontext/issues/2985). Keep `--with` for 1.6.1; fixes or pins on `master` do not change its published package. Install the binding before opening the 1.6.1 wizard so that it reuses the installed dependency.

**For other PowerContext releases**, first check that release's compatibility guidance. Use the command below only when its published dependency constraints select a supported binding; a broad extra range alone does not establish compatibility. If needed, add `--with "pylibseekdb==<binding-version>"` using an exact version verified for that release. If no compatible combination is established, stop and investigate. Replace `<version>` with the exact installed PowerContext version; do not change it just to use the 1.6.1 example:

```bash
uv tool install --force "powercontext[cli,server,seekdb]==<version>"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Avoid selecting the known failing published release/binding pair

The new default currently selects the known failing release/binding combination on macOS ARM64. The installer still selects the latest published PowerContext 1.6.1; its published extra requires pylibseekdb>=1.4.0.post2,<2. Resolving this exact command for macOS 15 ARM64 / CPython 3.12 selects 1.4.1.post2, and the verified 1.6.1 wheel still dispatches the frozen zstd_1.3.8 DDL unchanged. This is the combination reported in #2985; the fixes and exact binding pin on master are not in that release. Please constrain the supported binding for the published release, or gate this default on a release containing the fix, in both languages and the wizard path. I reproduced dependency selection and checked the released SQL dispatch; I did not rerun the native macOS crash.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hidb4ai Addressed in 7f83ef8. For PowerContext 1.6.1, both guides now explicitly pin pylibseekdb==1.4.0.post2 with --with before opening the wizard. The Gateway, plugin, and single-host team paths share this step. Other releases require a confirmed compatible binding; a broad extra range is not treated as compatibility evidence.

I verified the published 1.6.1 package in isolated tool/data directories on macOS 26.2 ARM64 with CPython 3.12.7. The documented command installed exactly 1.6.1 / 1.4.0.post2, the released wizard's dependency detector returned ready with no installation plan, and a fresh Server returned /health/ready with both database and runtime ready. Local make docs-test and all pre-commit checks passed.

The detector was invoked directly; the interactive wizard, other platforms, existing-database upgrades, and model-backed memory workflows were not exercised. Current-head CI has passed docs-tests and Windows link validation, but is not yet complete: check-website is still running, and backend/native installation jobs are skipped.

Could you recheck the installation instructions when convenient?

```

If dependency installation fails, stop and report the cause as required by the rules above. Preserve existing deployments' storage and binding compatibility: do not downgrade the binding and open a directory created by 1.4.1 with 1.4.0. Follow [database migrations](../operate/database-migrations.md) for an intentional engine change.

**Check:** `powercontext --version` is unchanged. When the Gateway is installed, `pc-gateway --version` reports the same release.

### When the plugin is already installed

Expand All @@ -122,6 +143,7 @@ Write the following to `<HOME>/powercontext/.env`, replace the values in angle b

```dotenv
POWERCONTEXT_SERVER_HTTP_PORT=17429
POWERCONTEXT_SERVER_DATABASE_KIND=seekdb
POWERCONTEXT_SERVER_INFERENCE_GENERATION_MODEL=openai-codex:<model>
CODEX_HOME='<CODEX_HOME>'
POWERCONTEXT_SERVER_INFERENCE_PROTECTION='{"mode":"disabled","targets":{"approved-codex":{"endpoint":"https://chatgpt.com/backend-api/codex/responses","model":"<model>","protocol":"openai-responses","allow_streaming":true}}}'
Expand All @@ -133,6 +155,7 @@ POWERCONTEXT_SERVER_INFERENCE_EMBEDDING_DIMENSION=<dimension>
OPENAI_API_KEY=
```

- When the platform does not support seekdb, change `POWERCONTEXT_SERVER_DATABASE_KIND` to `sqlite`. seekdb uses the `seekdb` subdirectory of the user data directory; SQLite uses the default persistent database path. Preserve existing deployments' configuration. seekdb does not accept `POWERCONTEXT_SERVER_DATABASE_URL`; a new seekdb deployment must not retain that variable in either its environment file or the Server process environment.
- Without an embedding model, delete the last four lines. For an embedding API other than OpenAI, rewrite the embedding lines as described in [Configure models](configure-models.md).
- Leave the `OPENAI_API_KEY=` line empty and ask the user to fill it in with an editor. Continue after the user confirms.
- Wrap the JSON value in single quotes; otherwise configuration parsing strips its double quotes.
Expand Down Expand Up @@ -294,7 +317,8 @@ exec opencode "$@"
Use this for other Agents, or when the Gateway is not used. Follow the [manual installation steps](https://powercontext.oceanbase.io/en/llms.mdx/docs/get-started/quickstart/content.md#install-manually), without returning to the Agent installation option, with these notes:

- Use the macOS/Linux or Windows installer from those steps, matching the target operating system and shell.
- **The setup wizard is interactive, and an Agent cannot operate it**. Ask the user to run `powercontext config init --language en --output .env` in their own terminal. In Claude Code and Codex, the user can type `! powercontext config init --language en --output .env` to run it directly. Tell the user what to choose from the step 2 answers: SQLite for storage, "Only on this machine" for the usage scenario, and full memory capabilities or basic memory according to question 3.
- For a new seekdb deployment, [install seekdb dependencies](#install-seekdb-dependencies) after the base installer and **before** `powercontext config init`. PowerContext 1.6.1 must use the command with `--with "pylibseekdb==1.4.0.post2"`; do not rely on its wizard to select the binding.
- **The setup wizard is interactive, and an Agent cannot operate it**. Ask the user to run `powercontext config init --language en --output .env` in their own terminal. In Claude Code and Codex, the user can type `! powercontext config init --language en --output .env` to run it directly. For a new deployment, explicitly tell the user to choose **seekdb** for storage and reuse the dependency installed above; do not simply accept the wizard's SQLite default. If it still asks to install a missing dependency, stop and check that the wizard is running the same PowerContext installation. Choose SQLite only when step 1 or the wizard confirms that the platform has no compatible seekdb wheel; stop and investigate installation or download failures. Preserve existing deployments' storage configuration. Choose "Only on this machine" for the usage scenario, and full memory capabilities or basic memory according to question 3.
- In the Agent connection step, choose the host only if the wizard offers it. For MiniMax, Kimi Code, ZCode, or another host without a connection-file option, choose **Finish Agent configuration**, confirm continuing without generated Agent configuration, and save the Server configuration. A missing wizard option does not mean a missing integration.
- The Quickstart registers the personal service with `powercontext service install`, so the Server starts at login.
- After the Server is ready, follow the selected host's guide in step 1 to install, configure, and diagnose its connection. Use the setup target in the table and the same release tag or checkout as the Server. Preserve the host-specific URL, authentication, Scope binding, and restart steps; do not mechanically replace `codex` in every Quickstart command.
Expand All @@ -317,7 +341,7 @@ Ask these questions at once, and state the defaults:
2. **Enable authentication**? Default: yes.
- With authentication, the Server generates one token and every member shares that one identity, with the same permissions and visibility. Distinguishing users requires injecting an Authentication Provider in the deployment.
- Without authentication is suitable only for a test environment on a trusted network. When authentication is enabled later, data written before then has no owner and cannot be modified until the administrator backfills it as described in [Migrate data written before enforcement](../operate/deploy-server.md#migrate-data-written-before-enforcement).
3. **Which storage**? Default for a single-host trial: SQLite, with one Server process in `all` mode and data on this host. For multiple replicas or separate API/background processes, use OceanBase. Confirm the existing MySQL-compatible user tenant and database; ask the administrator to fill the connection URL directly into the private configuration file, not into the conversation.
3. **Which storage**? Default for a new single-host trial: embedded seekdb, or SQLite when the platform does not support it, with one Server process in `all` mode and data on this host. Preserve existing deployments' storage configuration. For multiple replicas or separate API/background processes, use OceanBase. Confirm the existing MySQL-compatible user tenant and database; ask the administrator to fill the connection URL directly into the private configuration file, not into the conversation.
4. **Which generation and embedding models**? A team deployment uses model APIs, not a personal subscription. Ask for each provider, base URL (optional for OpenAI), and model name, and for the embedding model's dimension.
5. **Which features**? Explain each row of this table and let the administrator decide:

Expand All @@ -341,6 +365,8 @@ curl -fsSL https://powercontext.oceanbase.io/install.sh | bash -s -- --gateway

Without the Gateway, drop `-s -- --gateway`. Run the `export PATH=...` command that the installer prints at the end.

For a new embedded seekdb deployment, [install seekdb dependencies](#install-seekdb-dependencies) before configuring the Server. PowerContext 1.6.1 must use the command with `--with "pylibseekdb==1.4.0.post2"`. Skip this for SQLite or OceanBase. Stop and report any dependency installation failure rather than automatically switching to SQLite. When the Gateway is deployed, recheck that `powercontext --version` and `pc-gateway --version` match.

### Write the Server configuration

```bash
Expand All @@ -364,7 +390,16 @@ OPENAI_API_KEY=
- For another OpenAI-compatible service, add `POWERCONTEXT_SERVER_INFERENCE_GENERATION_BASE_URL` and `POWERCONTEXT_SERVER_INFERENCE_EMBEDDING_BASE_URL`. For a different protocol, rewrite the lines as described in [Configure models](configure-models.md).
- Leave `OPENAI_API_KEY=` empty and ask the administrator to fill it in. Continue after the administrator confirms.

**For a new SQLite deployment,** append this block. Replace `<HOME>` with the absolute home directory, keeping the resulting four slashes before an absolute Unix path:
**For a new embedded seekdb deployment,** append this block, replacing `<HOME>` with the absolute home directory:

```dotenv
POWERCONTEXT_SERVER_DATABASE_KIND=seekdb
POWERCONTEXT_SERVER_DATABASE_PATH=<HOME>/powercontext/seekdb
```

The instance is stored beside the configuration in `<HOME>/powercontext/seekdb`, with the default database name `powercontext`, accessed by one Server process in `all` mode. seekdb does not accept a SQLAlchemy URL; neither the environment file nor the Server process environment may retain `POWERCONTEXT_SERVER_DATABASE_URL`. For an existing deployment, preserve its instance path and database name rather than replacing them with this example; see [Use embedded seekDB](install-and-run.md#use-embedded-seekdb).

**For a new SQLite deployment on a platform without seekdb support,** append this block instead. Replace `<HOME>` with the absolute home directory, keeping the resulting four slashes before an absolute Unix path:

```dotenv
POWERCONTEXT_SERVER_DATABASE_KIND=sqlite
Expand Down Expand Up @@ -416,7 +451,7 @@ Without one-pass, append `POWERCONTEXT_SERVER_RUNTIME_ATOMIC_MEMORY_PROCESSING_M

### Initialize OceanBase before starting the Server

Skip this section for a new SQLite database; normal Server startup initializes it. For OceanBase, configure the model profiles above before planning maintenance. The following sequence is for a newly provisioned, empty application database. If the selected database already contains data, follow [database migrations](../operate/database-migrations.md) to review compatibility, stop all writers, and choose a verified backup policy before applying anything. Do not treat an existing database as empty or silently switch to `--backup skip`.
Skip this section for a new embedded seekdb or SQLite database; normal Server startup initializes it. For OceanBase, configure the model profiles above before planning maintenance. The following sequence is for a newly provisioned, empty application database. If the selected database already contains data, follow [database migrations](../operate/database-migrations.md) to review compatibility, stop all writers, and choose a verified backup policy before applying anything. Do not treat an existing database as empty or silently switch to `--backup skip`.

Run all maintenance commands on one fixed host with the same durable evidence directory. Keep that directory after initialization and use it for later inspection and maintenance of this database:

Expand Down
Loading