Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G GitLabMCP
  • Project information
    • Project information
    • Activity
    • Labels
    • Planning hierarchy
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Satyam Raj
  • GitLabMCP
  • Merge requests
  • !2

Merged
Created Aug 26, 2026 by Satyam Raj@satyamrajMaintainer

Harden KB retrieval/ingest and add split-host deploy tooling

  • Overview 0
  • Commits 1
  • Pipelines 1
  • Changes 21

Knowledge Base:

  • Replace naive TF sparse vectors with a real BM25 model: IDF-weighted document vectors (K1/B, length-normalized) and presence-indicator query vectors, persisted to data/bm25.json and reloaded by incremental sync. Colliding hashed indices are summed to avoid Qdrant 422s on duplicate indices.
  • Make the full ingest resumable: phase 1 persists the chunk set + BM25 model, phase 2 records an upsert cursor after each batch, so an interrupted multi-hour embed resumes instead of restarting. npm run reindex auto-resumes; --fresh forces a clean rebuild.
  • Retry embeddings with backoff on transient Ollama failures (sleep/timeout/5xx) so a long CPU-bound run self-heals.
  • Embed with nomic task prefixes (search_query/search_document) so query and document vectors share a space; toggle via EMBED_PREFIX_ENABLED.
  • Fix chunker heap-death on minified/single-line files (require a break past the window midpoint) and prepend the SOURCE header to every file chunk, not just the first, so all chunks retain project/file/URL provenance.
  • Cap oversized blob downloads and skip them (generated/minified files).
  • Put /api/stats and /api/recent behind requireAuth; default RERANK_MODEL off (stock Ollama has no /api/rerank).

GitLab MCP:

  • Register kb_* tools only when KB_URL is set, so no dead schema ships when the Knowledge Base is absent.
  • Cap read_file output (12k whole-file, 40k ranged) to protect the context window.
  • Drop the kb_ask reference from user_commits' description.

Deploy:

  • Add deploy/mcp-only/ (compose + env template + runbook) for the MCP-only box.
  • Add ARCHITECTURE-SPLIT / DEPLOYMENT-IDEATION docs and docker-compose.dev.yml for isolated local Qdrant/Ollama.

Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: feature/knowledgeBase