Actually search - #29
Merged
Merged
Conversation
Replace the previous template-based response (which only returned instructions on where to search) with a real streaming grep engine that returns file path, line number, and matched content — just like ripgrep. Key decisions: - Pure Node.js streaming regex grep as primary search (no binary deps, cross-platform, supports full JS/ripgrep regex: auth|login, \s+\w+, etc.) - MiniSearch (already a transitive dep) as optional pre-filter/ranker to limit candidate files on large docsets before line-level grep - OR syntax satisfied by native RegExp — no extra tooling needed - context_lines defaults to 0 (was 2); exposed as optional MCP param so callers can request 1–3 lines of surrounding context when needed Changes: - packages/core/src/search/searcher.ts — new core search engine (buildFileIndex, searchDocset, formatSearchResult) - packages/core/src/types.ts — SearchMatch, SearchDocsResult, SearchOptions types - packages/core/src/index.ts — export new search symbols - packages/mcp-server/src/server.ts — replace template processing with actual search; add context_lines param to search_docs tool schema - packages/core/src/__tests__/searcher.test.ts — 25 new unit tests - packages/mcp-server/src/__tests__/web-sources.test.ts — update 3 tests for new grep-style content[0].text response shape - test/e2e/mcp-protocol-compliance.test.ts — update 4 stale E2E tests that asserted old structuredContent/instructions response shape - docs/adr/001-search-engine-for-search-docs-tool.md — Nygard ADR with weighted Pugh matrix comparing ripgrep wrapper vs MiniSearch hybrid vs Node.js streaming grep (Option C wins, score +21 vs baseline)
mrsimpson
force-pushed
the
actually-search
branch
from
March 10, 2026 12:42
061617d to
cee9c3c
Compare
…server.ts
- packages/core: add minisearch@^7.1.2 to dependencies so CI installs it
(was only available locally as a transitive/hoisted dep)
- packages/mcp-server/server.ts: replace inline import('@agentic-knowledge/core').SearchOptions
with a proper named import from @codemcp/knowledge-core
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.