Skip to content

onboard: offer to index documents into the knowledgebase - #217

Merged
FMXExpress merged 2 commits into
mainfrom
claude/keen-einstein-kPEMj
Jun 10, 2026
Merged

FMXExpress merged 2 commits into
mainfrom
claude/keen-einstein-kPEMj

Conversation

@FMXExpress

Copy link
Copy Markdown
Owner

What

Adds a PromptKnowledgebase step to pasclaw onboard that offers to index document directories/files into the RAG knowledgebase during setup.

Why

The knowledgebase (kb_search / kb_get, added in #214) was previously only reachable via pasclaw kb add after onboarding. The natural moment to offer "index my documents" is right after the operator opts into local semantic search — that's the capability that makes pointing the agent at a doc corpus worthwhile.

Behavior

  • Gated strictly on the vector-search opt-in chosen earlier in the same flow (Cfg.VectorSearchEnabled). If the operator declines vectors, onboarding stays quiet and leaves pasclaw kb add for later.
  • Default NO, with an explicit blank-to-finish add loop — nothing is touched unless the operator asks.
  • Each entered directory/file becomes a KB source (indexed in place, never copied), then a single Sync runs so kb_search activates for the agent immediately.
  • ExpandHome on entered paths (ReadLine has no shell to expand ~).
  • Missing libsqlite3 degrades to a one-line skip, matching the rest of onboarding.

Verification

https://claude.ai/code/session_01LGQKz579j1ZnDRwmr6h1V6


Generated by Claude Code

Add a PromptKnowledgebase step to `pasclaw onboard`, gated on the
vector-search opt-in chosen earlier in the same flow. When the operator
enables local semantic search, onboarding now offers to add document
directories/files as KB sources and runs one Sync so kb_search activates
for the agent immediately.

- Gated strictly on Cfg.VectorSearchEnabled: declining vectors stays
  quiet and leaves `pasclaw kb add` for later.
- Default NO; explicit blank-to-finish add loop so nothing is touched
  unless the operator asks.
- ExpandHome on entered paths (ReadLine has no shell to expand ~).
- Missing libsqlite3 degrades to a one-line skip, matching the rest of
  onboarding.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ef931d99cd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

end;

PrintLn(' indexing...');
Idx.Sync(Files, Chunks);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Persist vector opt-in before indexing KB

When re-running onboarding from an existing config where vector_search_enabled is false, a user can enable vectors and add documents in the new prompt, but this Sync happens before SaveConfig(Cfg) writes the updated flag. TKBIndexImpl.TryEnsureVector reloads the on-disk config during Sync, sees the stale false value, and skips building the vector sidecar; later kb_search stays on FTS until the user manually runs pasclaw kb sync, even if they just provisioned the vector runtime in this flow.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Good catch — legit. Fixed in 94833c0: PromptKnowledgebase now calls SaveConfig(Cfg) immediately before Idx.Sync, so TryEnsureVector's LoadConfig reads the freshly-enabled flag instead of the stale on-disk false. The trailing SaveConfig at the end of Cmd_Onboard_Run stays and is idempotent.


Generated by Claude Code

Sync's TryEnsureVector reloads config.json from disk to decide whether
to build the vector sidecar. Onboarding's SaveConfig ran only at the end
of Cmd_Onboard_Run, after PromptKnowledgebase, so on a re-run that just
flipped vector_search_enabled false->true the on-disk value was still
stale when Sync read it -- the sidecar got skipped and kb_search stayed
FTS-only until a manual `pasclaw kb sync`.

Write the config right before indexing so the flag Sync reads matches
what the user just chose. The trailing SaveConfig stays and is
idempotent.

Addresses Codex P2 on #217.
@FMXExpress
FMXExpress merged commit 63c3313 into main Jun 10, 2026
FMXExpress pushed a commit that referenced this pull request Jun 13, 2026
Both changelog files were stuck at the 2026-06-10 TUI / background-
subagent / session_search / tool-RPC entries. ~7 weeks of merged
PRs (#214 through #244) had landed without a corresponding entry in
either file -- the git log was the only record of features like the
knowledgebase, inbound MCP server mode, checkpoints + /undo,
heartbeat daemon, shell backends (local | docker), send_message,
promptware defense, Windows shell-output encoding fixes, fs_grep
ripgrep optimisations, OpenTelemetry traces, and `pasclaw agent
--quiet`.

Added (newest first):

  2026-06-13
    #244  agent --quiet log-level clamp

  2026-06-12
    #243  dcc64 search path + agent --quiet / -q
    #242  OpenTelemetry traces (OTLP/HTTP+JSON)
    #241  fs_grep tier 5+6 (byte walker + Boyer-Moore-Horspool)
    #240  fs_grep tier 1-4 (deferred hash + skip-dirs + binary
          sniff + size cap)

  2026-06-11
    #239  Windows shell output: auto-detect UTF-8 vs OEM
    #238  Hashline fs_read header mojibake fix (¶ vs ¶)
    #237  Windows shell output: OEM codepage decode

  2026-06-10
    #233  Shell backends (local | docker via IShellBackend)
    #232  Heartbeat daemon + reversible condensation (CCR)
    #230  send_message tool + condenser families + promptware
          defense + task-aware MEMORY.md slicing

  2026-06-09
    #223  /goal Ralph loop + judge model + JSON-aware condenser
    #222  /undo wired into agent + sample dprojs
    #221  Checkpoints (auto-snapshot + TUI /undo)
    #220  mcp catalog: lenient hub projector
    #219  mcp: SSE / Streamable HTTP / stdio hub transports
    #218  Inbound MCP server mode
    #217  onboard: offer to index docs into the knowledgebase
    #214  Knowledgebase (RAG over operator-curated docs)

Skipped from this changelog (build-system / Delphi-fix / FPC-fix
PRs visible in the git log but not user-facing features):
#215, #216, #224, #225, #226, #227, #228, #229, #231, #234, #236.

Both files (README.md and docs/changelog.md) updated with the same
entries -- intentional mirror so a reader on either surface sees
the same history. Same prose in both; same footnote refs at the
bottom.

Validated: every [#N] reference in both files has a matching [#N]:
URL footnote (no broken links).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants