Skip to content

feat: workspace-level semantic search across all notebooks #6

Closed

Description

@stackbilt-admin

Problem

The v2 API only exposes notebook-scoped search (POST /api/v2/workspaces/{workspaceId}/notebooks/{notebookId}/search). There is no way to search across all notebooks in a workspace in a single request.

Why it matters

AEGIS uses MindSpring in its recall pipeline during every dispatch — recall.ts fires a semantic query in parallel with the Memory Worker to inject relevant context before generating a response. Currently this only hits the legacy global search endpoint (GET /api/search), which covers the original conversation archive.

We've now built a write pipeline that pushes extracted facts to per-topic notebooks (e.g. aegis, infrastructure, project) and session transcripts to a session_history notebook. These are dark at query time — ingested but never retrievable — because querying them would require:

  1. Listing all notebooks in the workspace
  2. Firing N parallel search requests (one per notebook)
  3. Merging and re-ranking results

That's too expensive per-dispatch (adds N subrequests + latency on the hot path).

Proposed endpoint

POST /api/v2/workspaces/{workspaceId}/search

Body: same shape as notebook search — { query, limit?, threshold? }

Response: results with a notebook_id + notebook_title field on each hit so callers can attribute the source.

This would be a one-line change in recall.ts:

/api/search?q=...  →  /api/v2/workspaces/aegis-daemon/search  (POST, body: { query, limit, threshold })

And would make all notebook content — session history, extracted facts, topic archives — retrievable on every AEGIS dispatch with zero added latency.

Alternative considered

Hardcoding specific notebook IDs in recall and firing parallel per-notebook searches. Rejected: IDs change across environments, and N parallel subrequests on the hot path is worse than one workspace search.

Activity

  1. stackbilt-admin commented on May 19, 2026

    @stackbilt-admin
    MemberAuthor

    Shipped in main via commit 6c7394e.

    Implemented workspace-level semantic search endpoint:

    • POST /api/v2/workspaces/{workspaceId}/search
    • Body: { query, limit?, threshold? }
    • Response: results[] now includes:
      • notebook_id
      • notebook_title

    Behavior:

    • Single vector query request, then workspace-scoped filtering across active notebooks in D1.
    • Avoids N-per-notebook fanout requests in hot paths.

    Validation:

    • npm run type-check passed
    • npm test passed
    • Deployed to production (Version ID: b3942836-7468-4970-b599-41389600a52e)

    AEGIS recall path can now switch from:

    • GET /api/search?q=...

    to:

    • POST /api/v2/workspaces/<workspaceId>/search with { query, limit, threshold }
  2. stackbilt-admin commented on May 19, 2026

    @stackbilt-admin
    MemberAuthor

    Closing as shipped in main via commit 6c7394e and deployed (Version ID: b3942836-7468-4970-b599-41389600a52e). Workspace-level search endpoint is now live.

  3. github-actions commented on May 19, 2026

    @github-actions

    ⚠️ This content may include sensitive data (phone).
    Please redact PII/secrets and replace with placeholders (for example, <CLIENT_A>, <TOKEN_REDACTED>).
    If this is a real vulnerability or secret exposure, use a private security advisory: https://github.com/Stackbilt-dev/mindspring/security/advisories/new

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions