Skip to content

Core Concepts

PT | EN

Understand the technological pillars that underpin Vectora and how it solves the fragmented context problem in complex codebases.

Vectora is not a chatbot. It is a Sub-Agent Tier 2 with governed context via MCP — designed to be called by main agents (Claude Code, Gemini CLI, VS Code) when they need precise context retrieval in code repositories.

Conceptual Map

    graph LR
    A[User Query] --> B[Context Engine]
    B --> C[Embeddings: Voyage 4]
    C --> D[Vector Search: MongoDB Atlas]
    D --> E[Reranker: Voyage 2.5]
    E --> F[Harness Runtime]
    F --> G[Governed Response]

    H[Trust Folder] -.-> F
    I[Guardian] -.-> F
    J[Namespaces] -.-> D
  

5 Essential Pillars

PillarWhat it is (new definition)Why it mattersLink
Context Engine2-stage retrieval pipeline: vector recall + precision via rerankingFinds code by functional similarity, not exact keywords→ Context Engine
EmbeddingsVector representation of code trained on real repositories (Voyage 4)Enables searching for “retry implementation” even without the word “retry” in code→ Embeddings
RerankerCross-encoder that reorders raw vector search resultsIncreases precision@5 from ~0.45 to ~0.89 — critical for useful responses→ Reranker
Harness RuntimeDistributed nervous system: orchestrates observation, auto-correction and governance in real-timeTransforms Gemini from “model that calls tools” to “agent that assists, evaluates and adjusts its own actions”→ Harness Runtime
Trust FolderFilesystem sandbox with path validation, symlink detection and BYOKPrevents directory traversal, secrets leakage and unauthorized file access→ Trust Folder

Deep Technical Concepts

Search & Retrieval (RAG for Code)

ConceptDescriptionWhen to use
Vector SearchSearch by embedding similarity in MongoDB Atlas Vector SearchWhen you need to find semantically similar code, not lexically identical
Embeddings & ModelsVoyage 4: 1536 dimensions, trained on code, 32K contextTo generate representations of code chunks that preserve functional meaning
RerankerVoyage Rerank 2.5: cross-encoder that evaluates pairs (query, chunk)To filter top-100 from vector search down to top-5 highly relevant results
Reranker LocalBM25 + heuristics for scenarios without VectorDB or mutable dataFor prototyping, ephemeral data or offline environments

Architecture & Runtime (The “Nervous System”)

ConceptDescriptionDifferentiation
Harness RuntimeDistributed pattern: Context Pipeline + Streaming Execution + Recovery Ladder + State ThreadingNot a module — it’s the intelligence that permeates prompt, tools, state and configuration
Trust FolderFilesystem isolation with fs.realpath, compiled blocklist in Go, BYOK“Shift-left” security: validation before execution, not post-hoc audit
NamespacesMulti-tenant logical isolation: projects, teams, environmentsAllows ingesting multiple repositories without cross-context pollution

Advanced Concepts (Scaling the Agent)

ConceptDescriptionUse case
RAG (Retrieval-Augmented Generation)Context enrichment pattern: retrieve → rerank → inject → generateFor any task requiring knowledge external to the model’s training
Sub-AgentsCoordination of specialized agents with isolated context and handoff via MCPWhen a complex task requires distinct phases (research → planning → execution)
State PersistenceMongoDB as unified backend for context, execution memory and audit trailFor long sessions, failure recovery and continuous learning

Complete Flow: Query → Governed Response

1. IDE/CLI makes query via MCP: "How to validate JWT tokens in middleware Go?"
2. Context Engine:
   - Parse query with AST-aware chunking
   - Generate embedding via Voyage 4 (fallback local if unavailable)
3. Vector Search (MongoDB Atlas):
   - Vector search: top-100 chunks by cosine similarity
   - Filter by namespace, permissions RBAC, Trust Folder
4. Reranker (Voyage 2.5):
   - Cross-encoder reorders top-100 → top-5 by semantic relevance
   - Metric precision@5 injected into Gemini context
5. Harness Runtime (Distributed):
   - [Observation] Gemini "watches" metrics: precision=0.89, confidence=0.94
   - [Auto-correction] If precision < 0.65 → retry with refined query
   - [Governance] Guardian validates: no paths outside Trust Folder, no secrets
   - [State] New iteration builds immutable AgentState with audit trail
6. Tool Executor:
   - Returns reranked chunks + metrics + audit log to model
   - Gemini synthesizes response with citations, links and context warnings
7. Response to User:
   - Code example with file attribution
   - Direct link to docs: cafegame.dev/docs/vectora/auth/jwt
   - Option: "Want me to analyze how this is implemented in YOUR project?"

Harness is not a “phase” in this flow — it is present in every arrow, observing, validating and adjusting agent behavior in real-time.

Guides by Profile

For Beginners (First 30 Minutes)

  1. Context Engine — Understand how Vectora “sees” code
  2. Vector Search — The technique behind semantic search
  3. Trust Folder — How to configure filesystem sandbox securely

For Developers (Daily Integration and Use)

  1. Harness Runtime — How Vectora self-evaluates and self-corrects
  2. Sub-Agents — When and how to delegate complex tasks
  3. MCP Protocol — Connecting Vectora to your favorite IDE/CLI

For Architects (Scalability and Governance)

  1. Namespaces — Multi-tenant isolation and access policies
  2. State Persistence — MongoDB as unified backend for context and audit
  3. Guardian — Immutable blocklist, path validation and BYOK in production

Frequently Asked Conceptual Questions

Why does Vectora use Voyage instead of OpenAI embeddings?

Voyage 4 was trained specifically on code repositories (GitHub, GitLab), resulting in embeddings that capture architectural patterns, language conventions and API semantics — something generic models don’t achieve with the same precision. → Embeddings

Is Harness Runtime a module I import?

No. Harness is a distributed architectural pattern — not a /harness folder in the code. It emerges from the interaction between: system prompt (meta-instructions), tool schemas (with observation hooks), state management (immutable + audit trail) and configuration (recovery ladder in YAML). → Harness Runtime

Can I use Vectora without MongoDB Atlas?

Yes, with limitations. Local Reranker enables intelligent search without VectorDB, ideal for prototyping or mutable data. However, for production with >10k chunks, MongoDB Atlas Vector Search offers scalability, automatic TTL and native integration with the ingestion pipeline. → Reranker Local


Questions about a concept? GitHub Discussions · Report docs error

External Linking

ConceptResourceLink
MongoDB AtlasAtlas Vector Search Documentationwww.mongodb.com/docs/atlas/atlas-vector-search/
Voyage EmbeddingsVoyage Embeddings Documentationdocs.voyageai.com/docs/embeddings
Voyage RerankerVoyage Reranker APIdocs.voyageai.com/docs/reranker
MCPModel Context Protocol Specificationmodelcontextprotocol.io/specification
MCP Go SDKGo SDK for MCP (anthropics/go-sdk)github.com/anthropics/anthropic-sdk-go
Gemini APIGoogle AI Studio & Gemini API Documentationai.google.dev/docs

Vectora v0.1.0 · GitHub · License (MIT) · Contributors

Part of the Vectora AI Agent ecosystem. Built with ADK, Claude, and Go.

© 2026 Vectora Contributors. All rights reserved.