diff --git a/docs/en/docs/get-started/agent-install.md b/docs/en/docs/get-started/agent-install.md index 1541704c29..3a931bd015 100644 --- a/docs/en/docs/get-started/agent-install.md +++ b/docs/en/docs/get-started/agent-install.md @@ -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: @@ -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=="` using an exact version verified for that release. If no compatible combination is established, stop and investigate. Replace `` 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]==" +``` + +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 @@ -122,6 +143,7 @@ Write the following to `/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: CODEX_HOME='' POWERCONTEXT_SERVER_INFERENCE_PROTECTION='{"mode":"disabled","targets":{"approved-codex":{"endpoint":"https://chatgpt.com/backend-api/codex/responses","model":"","protocol":"openai-responses","allow_streaming":true}}}' @@ -133,6 +155,7 @@ POWERCONTEXT_SERVER_INFERENCE_EMBEDDING_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. @@ -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. @@ -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: @@ -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 @@ -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 `` 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 `` with the absolute home directory: + +```dotenv +POWERCONTEXT_SERVER_DATABASE_KIND=seekdb +POWERCONTEXT_SERVER_DATABASE_PATH=/powercontext/seekdb +``` + +The instance is stored beside the configuration in `/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 `` with the absolute home directory, keeping the resulting four slashes before an absolute Unix path: ```dotenv POWERCONTEXT_SERVER_DATABASE_KIND=sqlite @@ -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: diff --git a/docs/zh/docs/get-started/agent-install.md b/docs/zh/docs/get-started/agent-install.md index 998f2b2bae..67d5f0c235 100644 --- a/docs/zh/docs/get-started/agent-install.md +++ b/docs/zh/docs/get-started/agent-install.md @@ -44,7 +44,8 @@ if (Get-Command powercontext -ErrorAction SilentlyContinue) { powercontext --ver - **网关运行位置**:原生包覆盖 Linux x86_64 或 arm64 且 glibc 2.28 以上,以及 macOS 15 以上的 Intel 或 Apple Silicon。原生 Windows 和 Alpine 等 musl 系统不能运行这些包。Windows 本机部署网关时,按 [WSL2 说明](../operate/install-gateway.md#windows)操作,Core 和提供方 CLI 也在该 Linux 环境中运行;分发 CI 尚未覆盖 WSL2 宿主集成。兼容的 Windows 客户端也可以连接远程网关,按宿主指南配置地址、Key 和协议。不使用网关时走[插件路径](#3b-插件路径)。 - **已安装的 Agent**:把检测到的命令作为第 2 步的建议。用户已指定宿主时,即使它的 CLI 不在 `PATH` 中,也应按该宿主继续核对:它可能是桌面应用、使用自定义启动器,或运行在另一台机器上。缺少命令不表示宿主不受支持。只询问无法从环境确定的目标或启动器信息。 - **Codex 凭据**:优先使用 `CODEX_HOME`,未设置时使用当前环境的用户主目录加 `.codex`。`auth.json` 存在只说明发现了凭据文件,不能证明订阅可用;Codex 也可以使用系统凭据库,因此缺少文件不代表未登录。下方的订阅路径要求 Core 和 Gateway 能访问文件凭据。请用户在该环境自己的终端用 `codex login status` 确认 ChatGPT 登录,只回报认证方式与是否成功,不粘贴原始输出。不要读取或复制凭据文件,也不要自动改变凭据存储方式。Windows 客户端的文件不能代表 WSL2 或远程网关的凭据。详见 [Codex 凭据存储](https://learn.chatgpt.com/docs/auth#credential-storage)。 -- **已有安装**:已经装有 PowerContext 时,先告诉用户版本,询问是升级还是保留,再继续。用户的 Agent 已经装有 PowerContext 插件时,记下来,第 3a 步要处理。 +- **默认存储**:新建本机部署默认使用嵌入式 seekdb。当前 `pylibseekdb` wheel 支持 Linux x86_64 或 arm64 且 glibc 2.28 以上,以及 macOS 15 以上的 Intel 或 Apple Silicon;还需与 Server 使用的 Python 兼容。原生 Windows、musl 系统、较旧的系统或其他没有兼容 wheel 的环境使用 SQLite,并向用户说明原因。WSL2 按其中的 Linux 环境判断,不按 Windows 宿主判断。网络、索引或下载失败不能视为平台不支持,也不能因此自动改用 SQLite。 +- **已有安装**:已经装有 PowerContext 时,先告诉用户版本,询问是升级还是保留,再继续。保留已有的存储后端、数据位置和数据库名称;默认选择只适用于新建部署,切换后端不会自动迁移数据。用户的 Agent 已经装有 PowerContext 插件时,记下来,第 3a 步要处理。 按下表选择宿主指南和 setup 目标。启动命令与 setup 目标名称可能不同: @@ -100,7 +101,27 @@ curl -fsSL https://powercontext.oceanbase.io/install.sh | bash -s -- --gateway 执行安装器最后打印的 `export PATH=...` 命令。 -**检查**:`powercontext --version` 和 `pc-gateway --version` 报告相同的版本。 +### 安装 seekdb 依赖 + +新建 seekdb 部署时,在基础安装器完成后、运行配置向导或启动 Server 前完成本步骤。插件路径和团队单机路径也使用本步骤;使用 SQLite 或 OceanBase 时跳过。 + +查看 `powercontext --version`,保留该 PowerContext 版本。**PowerContext 1.6.1** 需要显式安装已验证的 binding: + +```bash +uv tool install --force --with "pylibseekdb==1.4.0.post2" "powercontext[cli,server,seekdb]==1.6.1" +``` + +1.6.1 发布包的 extra 允许 `pylibseekdb>=1.4.0.post2,<2`,可能选中 [#2985](https://github.com/oceanbase/powercontext/issues/2985) 报告的 1.4.1.post2 失败组合。安装 1.6.1 时必须保留 `--with`;`master` 上的修复或版本固定不会改变已发布的包。先安装 binding,再打开 1.6.1 配置向导,让它复用已安装的依赖。 + +**其他 PowerContext 发行版**先核对该版本的兼容性说明。只有发布包的依赖约束会选中受支持的 binding 时,才能使用下面的命令;宽泛的 extra 范围本身不能证明兼容。必要时,使用该发行版已验证的准确版本追加 `--with "pylibseekdb=="`。无法确认兼容组合时,先停止并查明。将 `` 替换为已安装的准确 PowerContext 版本,不要为了套用 1.6.1 示例而更改它: + +```bash +uv tool install --force "powercontext[cli,server,seekdb]==" +``` + +依赖安装失败时按执行规则停止并报告原因。已有部署应保持存储与 binding 兼容,不要降级 binding 后用 1.4.0 打开 1.4.1 创建的数据目录。需要切换引擎时,按[数据库迁移](../operate/database-migrations.md)操作。 + +**检查**:`powercontext --version` 保持不变。安装了 Gateway 时,`pc-gateway --version` 报告相同的发行版本。 ### 已经装有插件时 @@ -122,6 +143,7 @@ mkdir -p "$HOME/powercontext" ```dotenv POWERCONTEXT_SERVER_HTTP_PORT=17429 +POWERCONTEXT_SERVER_DATABASE_KIND=seekdb POWERCONTEXT_SERVER_INFERENCE_GENERATION_MODEL=openai-codex: CODEX_HOME='' POWERCONTEXT_SERVER_INFERENCE_PROTECTION='{"mode":"disabled","targets":{"approved-codex":{"endpoint":"https://chatgpt.com/backend-api/codex/responses","model":"","protocol":"openai-responses","allow_streaming":true}}}' @@ -133,6 +155,7 @@ POWERCONTEXT_SERVER_INFERENCE_EMBEDDING_DIMENSION= OPENAI_API_KEY= ``` +- 平台不支持 seekdb 时,将 `POWERCONTEXT_SERVER_DATABASE_KIND` 改为 `sqlite`。seekdb 使用用户数据目录下的 `seekdb` 子目录,SQLite 使用默认持久化数据库路径;已有部署保留原配置。seekdb 不接受 `POWERCONTEXT_SERVER_DATABASE_URL`,新建 seekdb 部署的环境文件和 Server 进程环境中均不能保留该变量。 - 用户不配置嵌入模型时,删除最后四行。嵌入 API 不是 OpenAI 时,按[模型配置](configure-models.md)改写嵌入的几行。 - `OPENAI_API_KEY=` 这一行留空,请用户自己在编辑器中填写。用户确认填好后再继续。 - JSON 值必须用单引号包住,否则解析配置时会去掉其中的双引号。 @@ -294,7 +317,8 @@ exec opencode "$@" 适用于其他 Agent,或者不使用网关的情况。直接按[手动安装步骤](https://powercontext.oceanbase.io/zh/llms.mdx/docs/get-started/quickstart/content.md#手动安装)执行,不要回到“让 Agent 安装”的入口,并注意: - 使用其中对应 macOS/Linux 或 Windows 的安装器,匹配目标操作系统和 Shell。 -- **配置向导是交互界面,Agent 无法代为操作**。请用户在自己的终端运行 `powercontext config init --language zh --output .env`。在 Claude Code 和 Codex 中,用户可以输入 `! powercontext config init --language zh --output .env` 直接运行。告诉用户根据第 2 步的回答如何选择:存储选 SQLite,使用场景选"只在当前机器",记忆能力按第 3 题选择"完整记忆能力"或"基础记忆"。 +- 新建 seekdb 部署时,在基础安装器完成后、运行 `powercontext config init` **之前**[安装 seekdb 依赖](#安装-seekdb-依赖)。PowerContext 1.6.1 必须使用带 `--with "pylibseekdb==1.4.0.post2"` 的命令,不依赖该版本的向导来选择 binding。 +- **配置向导是交互界面,Agent 无法代为操作**。请用户在自己的终端运行 `powercontext config init --language zh --output .env`。在 Claude Code 和 Codex 中,用户可以输入 `! powercontext config init --language zh --output .env` 直接运行。新建部署时,明确告诉用户将存储选为 **seekdb**,复用上一步安装的依赖;不要直接接受向导的 SQLite 默认选项。如果仍提示安装缺失依赖,先停止并核对向导是否运行在同一份 PowerContext 安装中。只有第 1 步或向导确认平台没有兼容的 seekdb wheel 时才选 SQLite;安装或下载失败时停止并排查。已有部署保留原存储配置。使用场景选"只在当前机器",记忆能力按第 3 题选择"完整记忆能力"或"基础记忆"。 - 在 Agent 连接步骤中,只有向导提供了该宿主选项时才选择它。MiniMax、Kimi Code、ZCode 或其他没有连接文件选项的宿主,选择**结束 Agent 配置**,确认不生成 Agent 配置并继续,保存 Server 配置。向导缺少选项不等于没有集成。 - 快速开始用 `powercontext service install` 注册个人服务,Server 会在登录后自动启动。 - Server 就绪后,按第 1 步所选宿主的指南安装、配置并诊断连接。使用表中的 setup 目标,并与 Server 使用相同的发布 tag 或源码检出。保留宿主特有的 URL、认证、Scope 绑定和重启步骤,不要把快速开始中所有命令的 `codex` 机械替换成宿主名。 @@ -317,7 +341,7 @@ exec opencode "$@" 2. **开启认证吗**?默认开启。 - 开启后,Server 生成一个 Token,所有成员共用这一个身份,权限和可见范围相同。要区分用户,需要在部署中注入 Authentication Provider。 - 不开启只适合可信网络中的测试环境。之后再开启时,未开启期间写入的数据没有归属,需要管理员按[迁移认证开启前写入的数据](../operate/deploy-server.md#迁移认证开启前写入的数据)补齐后才能修改。 -3. **存储用什么**?单机试用默认 SQLite,数据保存在本机,由一个 `all` 模式的 Server 进程访问。需要多副本或拆分 API 与后台进程时,使用 OceanBase。确认已有 MySQL 兼容用户租户和数据库,请管理员把连接 URL 直接填入私有配置文件,不要粘贴到对话中。 +3. **存储用什么**?新建单机试用默认嵌入式 seekdb,平台不支持时使用 SQLite,数据保存在本机,由一个 `all` 模式的 Server 进程访问。已有部署保留原存储配置。需要多副本或拆分 API 与后台进程时,使用 OceanBase。确认已有 MySQL 兼容用户租户和数据库,请管理员把连接 URL 直接填入私有配置文件,不要粘贴到对话中。 4. **生成模型和嵌入模型**?团队部署使用模型 API,不使用个人订阅。询问各自的服务商、Base URL(OpenAI 官方可省略)、模型名,以及嵌入模型的维度。 5. **使用哪些功能**?逐项说明下表,由管理员决定: @@ -341,6 +365,8 @@ curl -fsSL https://powercontext.oceanbase.io/install.sh | bash -s -- --gateway 不部署网关时去掉 `-s -- --gateway`。执行安装器最后打印的 `export PATH=...` 命令。 +新建嵌入式 seekdb 部署时,在配置 Server 前[安装 seekdb 依赖](#安装-seekdb-依赖)。PowerContext 1.6.1 必须使用带 `--with "pylibseekdb==1.4.0.post2"` 的命令;使用 SQLite 或 OceanBase 时跳过。依赖安装失败时停止并报告原因,不要自动改用 SQLite。部署了网关时,再确认 `powercontext --version` 和 `pc-gateway --version` 一致。 + ### 写入 Server 配置 ```bash @@ -364,7 +390,16 @@ OPENAI_API_KEY= - 使用 OpenAI 兼容的其他服务时,增加 `POWERCONTEXT_SERVER_INFERENCE_GENERATION_BASE_URL` 和 `POWERCONTEXT_SERVER_INFERENCE_EMBEDDING_BASE_URL`;协议不同的服务按[模型配置](configure-models.md)改写。 - `OPENAI_API_KEY=` 留空,请管理员自己填写,确认填好后再继续。 -**新建 SQLite 部署时**追加下面的配置。把 `` 换成主目录的绝对路径,保留绝对 Unix 路径前形成的四个斜杠: +**新建嵌入式 seekdb 部署时**追加下面的配置,把 `` 换成主目录的绝对路径: + +```dotenv +POWERCONTEXT_SERVER_DATABASE_KIND=seekdb +POWERCONTEXT_SERVER_DATABASE_PATH=/powercontext/seekdb +``` + +实例保存在配置旁边的 `/powercontext/seekdb`,默认数据库名称为 `powercontext`,由单个 `all` 模式的 Server 进程访问。seekdb 不接受 SQLAlchemy URL,环境文件和 Server 进程环境中均不能保留 `POWERCONTEXT_SERVER_DATABASE_URL`。已有部署保留原实例路径和数据库名称,不要用本例覆盖;详情见[使用嵌入式 seekDB](install-and-run.md#使用嵌入式-seekdb)。 + +**平台不支持 seekdb、新建 SQLite 部署时**改为追加下面的配置。把 `` 换成主目录的绝对路径,保留绝对 Unix 路径前形成的四个斜杠: ```dotenv POWERCONTEXT_SERVER_DATABASE_KIND=sqlite @@ -416,7 +451,7 @@ POWERCONTEXT_SERVER_INFERENCE_PREFIX_EXTRACTION_GATEWAY_URL=http://127.0.0.1:878 ### 启动 Server 前初始化 OceanBase -新建 SQLite 数据库可跳过本节,由正常 Server 启动流程初始化。OceanBase 应在上面的模型配置完成后再生成维护计划。下面的流程用于刚创建的空应用数据库。所选数据库已有数据时,先按[数据库迁移](../operate/database-migrations.md)检查兼容性、停止全部写入并选择已验证的备份方式,再执行维护。不要把已有库当成空库,也不要自动改用 `--backup skip`。 +新建嵌入式 seekdb 或 SQLite 数据库可跳过本节,由正常 Server 启动流程初始化。OceanBase 应在上面的模型配置完成后再生成维护计划。下面的流程用于刚创建的空应用数据库。所选数据库已有数据时,先按[数据库迁移](../operate/database-migrations.md)检查兼容性、停止全部写入并选择已验证的备份方式,再执行维护。不要把已有库当成空库,也不要自动改用 `--backup skip`。 全部维护命令使用同一台固定主机和同一个持久证据目录。初始化后保留该目录,后续对这个数据库的检查和维护继续使用它: