Skip to main content
Glama
sagarv48

Knowledge Fabric

Knowledge Fabric


⚡ 30-Second Quickstart

1. Instant Cloud Sandbox (Zero Local Setup)

Click to launch a fully configured browser VS Code workspace with PostgreSQL + pgvector and Tika running automatically:

Open in GitHub Codespaces

2. Connect to Claude Desktop or Cursor (MCP)

Give Claude Desktop or Cursor private, local long-term memory over your enterprise codebase and documents. Add this to your claude_desktop_config.json:

{
  "mcpServers": {
    "knowledge-fabric": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm",
        "-e", "DATABASE_URL=postgresql://knowledge_fabric:knowledge_fabric@host.docker.internal:5432/knowledge_fabric",
        "ghcr.io/sagarv48/knowledge-fabric:0.1.1",
        "knowledge-fabric-mcp"
      ]
    }
  }
}

3. Run Locally with Docker Compose (60 Seconds)

git clone https://github.com/sagarv48/knowledge-fabric.git && cd knowledge-fabric
docker compose up -d

# Run the interactive hybrid RRF demonstration
python examples/quickstart_interactive.py

Related MCP server: mcp-rag-service

Why Knowledge Fabric?

The $100k/Year Dedicated Vector DB Trap vs. The PostgreSQL Reality

Most enterprise AI initiatives stall not because of model capability, but because of operational sprawl, data leakage, and ungrounded retrieval. Traditional architectures force engineering teams to introduce dedicated vector databases (Pinecone, Qdrant, Weaviate), creating a second source of truth, new vendor contracts, complex VPC peering, and $50k–$100k/year in recurring cloud spend.

Knowledge Fabric eliminates this entire infrastructure tier by running directly on your existing PostgreSQL database with pgvector HNSW indexes and native full-text search (tsvector), combined with Reciprocal Rank Fusion (RRF):

Challenge with Traditional Stacks

The Knowledge Fabric Enterprise Architecture

Forced Database Sprawl: Introducing specialized vector databases requires separate VPC peering, backup regimes, and $2,000–$10,000/mo in dedicated infrastructure.

Runs on your existing PostgreSQL: Combines pgvector HNSW with PostgreSQL full-text search (tsvector) in a single ACID database. Zero new infrastructure to operate.

Naive Cosine Search Misses Exact Terms: Pure vector search frequently misses critical error codes, IDs, SKUs, drug names, and legal terms.

Hybrid RRF + Neural Reranking: Reciprocal Rank Fusion (k=60) merges BM25 lexical precision with dense vector semantics, refined by local cross-encoders.

Cross-Tenant Data Contamination: Naive vector stores expose all chunks globally, risking cross-tenant data leakage in multi-tenant SaaS.

Dual-Mode Multi-Tenancy: Application-level tenant isolation by default, plus opt-in PostgreSQL Row-Level Security (RLS) for HIPAA and SOC 2 compliance.

Vendor API Lock-In & Recurring Cost: Cloud frameworks default to proprietary embedding APIs, risking breaking changes and per-token fees.

100% Local & Open by Default: Ollama & sentence-transformers run offline and free on CPU/GPU. OpenAI and Cohere are drop-in alternatives.

Framework Monoliths: LlamaIndex and LangChain force you into proprietary prompt abstraction libraries.

Clean FastMCP Boundary: Exposes retrieval as a standard Model Context Protocol (MCP) server that any agent or framework can consume.


Industry Decision & Adoption Matrix

How actual CTOs deploy Knowledge Fabric across enterprise verticals:

Vertical

Primary Compliance & Architectural Concern

Knowledge Fabric Solution

Impact & ROI

Fintech & Banking

Strict SEC/FINRA audit trails, zero public cloud data leakage, exact compliance code matching.

Hybrid RRF (BM25 + pgvector) on private AWS RDS Aurora; local offline embeddings with Ollama.

Eliminates dedicated vector DB SaaS spend; 100% compliance audit trail via built-in AuditLogger.

Healthcare & Pharma

HIPAA compliance, patient PII containment, medical terminology precision.

Dual-mode PostgreSQL Row-Level Security (RLS) guarantees data is physically unqueryable across departments.

Zero cross-tenant leakage risk; passes strict clinical HIPAA review.

Enterprise B2B SaaS

Multi-tenancy at scale (50M+ chunks), sub-10ms query latency, fast self-hosting.

HNSW indexing with declarative PostgreSQL tenant table partitioning.

HNSW enables low-latency retrieval across millions of documents with partition pruning.

DevOps & Cloud SRE

Automated incident triage, runbook citation, turnkey Kubernetes deployment.

Multi-arch Docker containers, Docker Compose stack, and FastMCP server.

Rapid local deployment; grounded runbook retrieval for on-call agents.

Architecture

flowchart TB
    subgraph Ingestion ["1. INGESTION PIPELINE"]
        Sources["Enterprise Docs\n(MD, PDF, DOCX, HTML)"] --> Tika["Apache Tika\n(Text Extraction)"]
        Tika --> Chunker["Document Chunker\n(Sliding Window)"]
        Chunker --> Embedder["Embedding Provider\n(Ollama / OpenAI / Cohere)"]
    end

    subgraph Storage ["2. POSTGRESQL + PGVECTOR"]
        Embedder --> Chunks[("chunks table\n• Full-text tsvector (BM25)\n• pgvector embedding\n• tenant_id & metadata")]
    end

    subgraph Retrieval ["3. RETRIEVAL & FUSION ENGINE"]
        Query["User / Agent Query\n(with tenant_id)"] --> Lexical["Lexical Search\n(tsvector English)"]
        Query --> Vector["Dense Vector Search\n(Cosine Distance)"]
        Chunks -.-> Lexical
        Chunks -.-> Vector
        Lexical --> RRF["Hybrid Fusion\n(RRF k=60)"]
        Vector --> RRF
        RRF --> Reranker["Cross-Encoder Reranker\n(sentence-transformers / Cohere)"]
    end

    subgraph Interface ["4. AUDITABLE EVIDENCE CONSUMPTION"]
        Reranker --> EvidencePkg["Structured Evidence Package\n• Ranked snippets with citations\n• Provenance trace & scores\n• Audit event log"]
        EvidencePkg --> MCPServer["MCP Server\n(retrieve_evidence)"]
        MCPServer --> Downstream["Intent Fabric / AI Agent / Claude / Cursor"]
    end

Quickstart & Deployment Options

Choose the consumption pathway that fits your architecture:

⚡ Pathway 1: Python Developers & MCP Users

If you are importing the retrieval engine into Python code, custom agents, or running MCP:

# Install core package from PyPI
pip install knowledge-fabric

# Or install with neural rerankers
pip install "knowledge-fabric[reranking]"

# Run the MCP server directly via uvx (zero-installation):
uvx knowledge-fabric-mcp

🐳 Pathway 2: Turnkey Evaluation (Docker Compose)

Spin up the entire multi-tenant stack (PostgreSQL + pgvector, Apache Tika, and Admin UI) in seconds:

# Clone or download docker-compose.prod.yml
curl -sSL https://raw.githubusercontent.com/sagarv48/knowledge-fabric/main/docker-compose.prod.yml -o docker-compose.yml

# Start full platform with pgvector and Tika
docker compose up -d

# Access Visual Admin Console at: http://localhost:8080

☸️ Pathway 3: Kubernetes Deployment (Planned)

Helm chart packaging is planned. For now, deploy the Docker image directly to your cluster using standard Kubernetes Deployment + Service manifests, pointing to your external RDS / Cloud SQL instance.

NOTE

Thehelm install oci://ghcr.io/sagarv48/charts/knowledge-fabric command shown in earlier versions targets a Helm OCI registry that has not yet been published. Watch the releases page for the first official Helm chart release.

🛠️ Pathway 4: Local Contributor Setup

git clone https://github.com/sagarv48/knowledge-fabric.git
cd knowledge-fabric
python3 -m pip install -e ".[reranking,dev]"
docker compose up -d postgres tika
EMBEDDING_PROVIDER=ollama knowledge-fabric-ingest --path ./docs --recursive --embed --tenant engineering
knowledge-fabric-mcp

Model Provider Strategy: Zero Lock-In

Configure your preferred embedding and reranking providers with environment variables or config/settings.yaml:

Embedding Providers

Provider

Setup / Environment

Vector Dim

Cost / Hardware

Ollama (Recommended)

EMBEDDING_PROVIDER=ollamaollama pull nomic-embed-text

768

Free & Local (CPU or GPU)

OpenAI

EMBEDDING_PROVIDER=openaiOPENAI_API_KEY=sk-...

1536

Commercial API

Cohere

EMBEDDING_PROVIDER=cohereCOHERE_API_KEY=...

1024

Commercial API

Mock

EMBEDDING_PROVIDER=mock

1536

Deterministic (Dev/CI only)

Reranking Providers

Provider

Configuration

Characteristics

Passthrough (Default)

RERANKER=passthrough

Fast zero-latency RRF ranking without neural reranking.

Cross-Encoder

RERANKER=cross_encoder

Local neural model (ms-marco-MiniLM-L-6-v2) via sentence-transformers. Free & private.

Cohere

RERANKER=cohereCOHERE_API_KEY=...

Cloud reranking via Cohere Rerank API.


Dual-Mode Multi-Tenancy

Knowledge Fabric provides two isolation layers to accommodate both lightweight development and regulated enterprise environments:

Mode 1: Application-Level Filtering (Default)

Every query and ingestion specifies tenant_id:

pipeline.retrieve_evidence(
    query_text="emergency access procedures",
    tenant_id="healthcare-corp-a",
    top_k=5,
)

SQL queries automatically include WHERE d.tenant_id = %s. Requires no special database privileges.

Mode 2: PostgreSQL Row-Level Security (RLS)

For HIPAA, SOC2, or government environments requiring database-enforced isolation:

-- Enable RLS across all tables with one command:
SELECT enable_tenant_rls();

PostgreSQL kernel rejects any access that does not set session variable app.tenant_id:

SET LOCAL app.tenant_id = 'healthcare-corp-a';

Even if application code contains a bug or omission, cross-tenant data leakage is physically impossible.


Model Context Protocol (MCP) Tools

Knowledge Fabric exposes standard MCP tools for LLMs, desktop assistants, and workflow runners:

Tool Name

Parameters

Description

retrieve_evidence

query_text (str), tenant_id (str|null), top_k (int), source_type (str|null), trace_id (str|null), mode (str: hybrid|lexical|vector)

Executes retrieval (hybrid RRF, lexical full-text, or semantic vector) and returns structured evidence package with citations, per-leg health, and relevance scores.

get_evidence

chunk_id (int), tenant_id (str|null)

Retrieves a specific cited chunk by its database ID with complete provenance and metadata.

get_document

document_id (int|null), source_uri (str|null), tenant_id (str|null)

Retrieves the full content and metadata for a specific document, scoped to tenant.

explain_retrieval

query_text (str), top_k (int), source_type (str|null), tenant_id (str|null), mode (str)

Returns detailed diagnostics: lexical ranks, vector distances, per-leg latencies, and RRF fusion scores.

get_index_status

tenant_id (str|null)

Returns index health diagnostics: total documents, total chunks, and document counts per source type.

check_consistency

tenant_id (str|null)

Audits relational database invariants (orphaned chunks, empty docs, null tenants, missing embeddings).

health_check

None

Verifies database connectivity, row counts, embedding provider status, and dimension alignment.

list_sources

tenant_id (str|null)

Lists ingested document source types and document counts, scoped to the calling tenant.

Adding to Claude Desktop / Cursor

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "knowledge-fabric": {
      "command": "python",
      "args": ["-m", "knowledge_fabric.mcp.server"],
      "env": {
        "DATABASE_URL": "postgresql://knowledge_fabric@localhost:5432/knowledge_fabric",
        "EMBEDDING_PROVIDER": "ollama",
        "RERANKER": "cross_encoder",
        "KF_DEFAULT_TENANT": "default"
      }
    }
  }
}

Retrieval Benchmark

Run the included benchmark evaluation suite to compare retrieval accuracy across strategies:

python benchmarks/evaluate_retrieval.py
NOTE

The numbers below areillustrative — generated by running python benchmarks/evaluate_retrieval.py on a small synthetic operational corpus. Run the command yourself on your own corpus to produce numbers that reflect your data and query distribution. Results will differ by domain, chunk size, and embedding model.

Retrieval Strategy         | NDCG@10    | MRR@10     | Recall@10  | vs Vector
----------------------------------------------------------------------------
Lexical Only (BM25)        | 0.7240     | 0.6850     | 0.8200     | -10.4%
Vector Only (Cosine)       | 0.8082     | 0.7600     | 0.8800     | baseline
Hybrid Fusion (RRF)        | 0.8924     | 0.8750     | 0.9500     | +10.4%
Hybrid + Reranker          | 0.9416     | 0.9600     | 0.9800     | +16.5%
----------------------------------------------------------------------------

SaaS Source Connectors

Ingest content directly from enterprise platforms with the unified knowledge-fabric-sync CLI:

# Ingest Confluence spaces into tenant 'engineering'
knowledge-fabric-sync --connector confluence --url "https://mycorp.atlassian.net/wiki" --space ENG,PROD --tenant engineering --embed

# Ingest Notion databases
knowledge-fabric-sync --connector notion --token "$NOTION_API_KEY" --database-id "<id>" --tenant product --embed

# Ingest Google Drive folder / Google Docs
knowledge-fabric-sync --connector gdrive --token "$GOOGLE_ACCESS_TOKEN" --folder-id "<id>" --tenant legal --embed

# Ingest Jira resolved incidents & ADRs
knowledge-fabric-sync --connector jira --url "https://mycorp.atlassian.net" --jql "project = SEC AND status = Done" --tenant security-ops --embed

Large-Scale Vector Performance & Pluggable Backends

Knowledge Fabric is built to grow with your infrastructure from early prototyping to 100M+ vectors:

  1. HNSW Indexing (Migration 005): Upgrade from IVFFlat to HNSW for 10x higher QPS and sub-10ms latency:

    SELECT upgrade_to_hnsw_index(m_val => 16, ef_val => 64);
  2. Declarative Tenant Partitioning: Partition the chunks table by tenant_id. Queries for a specific tenant scan only that tenant's dedicated partition index, enabling PostgreSQL to support tens of millions of vectors with partition pruning.

  3. Pluggable Vector Store Protocol: For ultra-large enterprise clusters with existing dedicated vector infrastructure, plug in Qdrant with zero application changes:

    export RETRIEVAL_STORE_BACKEND=qdrant
    export QDRANT_URL=http://qdrant-cluster:6333

Visual Admin & Governance UI

Knowledge Fabric includes a visual management console with zero Node/NPM dependencies:

knowledge-fabric-ui --port 8080
# Open http://localhost:8080/ in your browser

Features:

  • 🛡️ Human-in-the-Loop Approval Queue: Authorize or reject pending action plans with audit comments.

  • 🔍 Interactive Retrieval Playground: Inspect side-by-side BM25, Cosine, RRF, and Cross-Encoder score distributions and citations.

  • 📜 Live Audit Trail: Chronological event viewer tracking queries, latencies, and security events.

  • ⚙️ Policy Engine Sandbox: Test proposed agent action strings against active YAML rules with instant match highlighting.


End-to-End Enterprise Example

See examples/04-end-to-end-with-intent: A complete demonstration ingesting enterprise policy documents, querying hybrid evidence with multi-tenant partitioning, planning safe actions with Intent Fabric, evaluating YAML policy rules, and emitting an audit-ready approval package.

python examples/04-end-to-end-with-intent/run.py

Contributing

We welcome community contributions! Please see CONTRIBUTING.md for development setup, how to add new embedding/reranking providers, and coding standards.

Security

Please report security issues responsibly. See SECURITY.md for our vulnerability disclosure policy.

License

Licensed under the Apache License, Version 2.0.

Available Tools

8 tools
check_consistencyB

Run database consistency audits (detecting orphaned chunks, empty documents, null tenants).

ParametersJSON Schema
NameRequiredDescriptionDefault
tenant_idNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

B3.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the burden of explaining behavior. It communicates that the tool performs an audit and lists the anomalies detected, implying a read-only operation, but it doesn't explicitly state that it does not modify data, how failures are surfaced, or what the output contains beyond what the output schema already captures.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single, front-loaded sentence that states the action, target, and key detection cases with no filler. Every clause contributes to understanding the tool's purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple and has an output schema, so the description doesn't need to explain return values. However, missing tenant_id semantics and the absence of guidance about when the audit is appropriate leave notable gaps for an agent deciding how to call it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description does not explain what tenant_id actually does. The mention of 'null tenants' refers to an anomaly type, not the parameter's filtering semantics, so an agent cannot tell whether providing tenant_id scopes the audit or how it changes results.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb ('Run') and resource ('database consistency audits') and then enumerates what the audit detects. This makes its purpose concrete and clearly distinguishes it from siblings like health_check, which likely targets system health rather than data integrity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives no guidance on when to run the audit versus alternatives, nor when to omit or provide tenant_id. It implies a data-integrity use case through the listed checks, but leaves the caller to infer the appropriate context and does not mention any exclusions or sibling alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

explain_retrievalB

Return diagnostic tracing and candidate scoring explanations for a query.

Explains candidate counts, per-leg latencies, fusion scores, and degradation status without persisting audit logs.

ParametersJSON Schema
NameRequiredDescriptionDefault
modeNohybrid
top_kNo
tenant_idNo
query_textYes
source_typeNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

B3.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are present, so the description carries the full behavioral burden. It does disclose one meaningful side-effect constraint—'without persisting audit logs'—but it does not explicitly state whether the tool is read-only or whether it executes a live retrieval with its own cost/latency. This is partial transparency, not complete.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact and front-loaded, with the core purpose in the first sentence and an important no-audit-log caveat in the second. The slight overlap between 'diagnostic tracing and candidate scoring explanations' and the subsequent enumeration of those components is acceptable and not wasteful.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With five parameters, zero schema parameter descriptions, and no annotations, the description is incomplete as an operational contract. The output schema likely covers return structure, but the agent still lacks essential guidance on how mode, tenant_id, and source_type change the behavior of the tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, yet the description adds no meaning for any of the five parameters. It never explains how mode, top_k, tenant_id, source_type, or query_text affect the diagnostic output; it only describes what is returned, leaving the agent to guess parameter behavior.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first sentence names a specific verb-resource pair: 'Return diagnostic tracing and candidate scoring explanations for a query.' The second sentence enumerates concrete outputs (candidate counts, per-leg latencies, fusion scores, degradation status), which clearly distinguishes this from sibling tools like retrieve_evidence or health_check.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The diagnostic framing implies when the tool should be used, but the description never explicitly says 'use this when you need to explain or trace retrieval, not when you need actual evidence.' It gives no alternatives or when-not conditions, so an agent must infer the intended selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_documentD
ParametersJSON Schema
NameRequiredDescriptionDefault
tenant_idNo
source_uriNo
document_idNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

D1/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Tool has no description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness1/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Tool has no description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Tool has no description.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Tool has no description.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose1/5

Does the description clearly state what the tool does and how it differs from similar tools?

Tool has no description.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines1/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Tool has no description.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_evidenceB

Fetch a specific evidence chunk by its integer chunk ID, scoped to tenant.

ParametersJSON Schema
NameRequiredDescriptionDefault
chunk_idYes
tenant_idNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden for behavioral disclosure. It does state that the operation is a fetch (implying read-only) and that results are scoped to tenant, which is useful. However, it does not explain what happens when the chunk_id is not found, whether tenant_id is required for scoping despite its default null, or any permission constraints.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, compact sentence that front-loads the action and key identifiers. Every phrase contributes meaning, and there is no redundant or filler content. It is an example of efficient, well-structured documentation.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The presence of an output schema covers return values, so the description does not need to detail them. What is missing is guidance on when to use this tool versus the closely named sibling retrieve_evidence, and any clarification of optional tenant scoping. For a simple get-by-id tool it is mostly adequate, but it leaves minor usage context gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It does add meaning by clarifying that chunk_id is an integer ID for an evidence chunk and that tenant_id relates to tenant scoping. However, it omits the optional/nullable nature of tenant_id and does not specify how the scoping behaves when tenant_id is null, leaving important semantic details uncovered.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Fetch') with a clear resource ('specific evidence chunk') and an unambiguous identifier ('integer chunk ID'), plus scoping ('scoped to tenant'). It effectively conveys the core operation, though it does not explicitly name or contrast sibling tools like retrieve_evidence, so differentiation relies on the phrase 'by its integer chunk ID'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no explicit guidance about when to use this tool versus retrieve_evidence or other siblings, and it does not state any exclusions or prerequisites. Usage is only implied: if you have a chunk ID and need that chunk, you might call this. No alternatives or contextual cues are given.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_index_statusA

Return diagnostic index breakdown: document/chunk counts, sources, and storage status.

Scoped to tenant_id when provided.

ParametersJSON Schema
NameRequiredDescriptionDefault
tenant_idNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations exist, so the description carries the disclosure burden. It does reveal useful behavior: the result includes counts, sources, and storage status, and scoping is conditional on tenant_id. However, it does not state whether the operation is read-only, what side effects may exist, or whether special permissions are needed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two tightly written sentences with zero filler. The core action and return contents are front-loaded, and the scoping note is a separate, clearly stated condition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-optional-parameter diagnostic tool with an output schema, the description is largely complete: it states what is returned, the main parameter's role, and the scoping behavior. It lacks usage guidance relative to siblings, but that is already penalized in dimension 2.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must compensate. It does so by explaining that tenant_id is a scoping filter: 'Scoped to tenant_id when provided.' This adds real meaning beyond the schema's bare type/default, though it could specify how the scope is applied.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource: 'Return diagnostic index breakdown' and enumerates concrete contents (document/chunk counts, sources, storage status). This distinguishes it from siblings like health_check and list_sources, which are broader or differently scoped.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is given about when to choose this tool over siblings. The only additional sentence, 'Scoped to tenant_id when provided,' describes filtering behavior, not usage context or alternatives. An agent is left to infer when this is the right diagnostic tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

health_checkA

Check server health and return runtime configuration.

Returns embedding provider name and dimension, DB connectivity status, and approximate document/chunk counts. Useful for AI agents to orient themselves before querying.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the behavioral disclosure burden. It openly states that counts are approximate and that the tool reports DB connectivity and runtime configuration, which is useful. It does not explicitly state that the operation is read-only or describe any side effects, though the name and purpose strongly imply a safe, non-mutating probe.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact and front-loaded: the first sentence states the main action, the second details the returned information, and the third gives the intended use case. Every sentence adds value and there is no redundant or filler content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a no-parameter health check with an output schema, the description is complete: it states what the tool does, what it returns, and when to use it. The agent can correctly select and invoke this tool without needing additional context.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, so the empty input schema fully covers invocation needs and no parameter documentation is required. The description adds no parameter semantics because there are none, and the baseline for zero-parameter tools is appropriately high.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly identifies a specific action and resource: checking server health and returning runtime configuration. It also frames the tool as a pre-query orientation step, which separates it from retrieval-focused siblings like retrieve_evidence and get_document. However, it does not explicitly differentiate itself from get_index_status, whose name also suggests a status-checking role.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly says the tool is useful for AI agents to orient themselves before querying, giving a clear context for when to call it. It does not name alternative tools or state exclusions, but for a zero-parameter health check that is a minor gap.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_sourcesA

List ingested source types and document counts for a tenant.

Returns distinct source_type values with document counts so an AI agent can discover what content domains are available before issuing a query. Use source_type as a filter in retrieve_evidence to scope retrieval. Scoped to tenant_id when provided.

ParametersJSON Schema
NameRequiredDescriptionDefault
tenant_idNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the behavioral burden. It discloses that the tool returns distinct source_type values with counts and that results are scoped to tenant_id when provided. This is enough for a read-only metadata listing, though it does not cover edge cases like empty results or permission requirements.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact and front-loaded with the verb and resource. Every sentence adds necessary context: what is returned, why an agent would call it, how to apply the result, and how the optional parameter behaves.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with one optional parameter and an output schema, the description is complete. It explains purpose, usage, return content, and parameter behavior, leaving no critical ambiguity for an agent deciding whether and how to call it.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It does by explaining that tenant_id scopes the results when provided, adding behavioral meaning beyond the raw schema. It does not detail the parameter type or omission behavior, but the schema and the phrase 'when provided' make the optionality clear.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb and resource: it lists ingested source types and document counts for a tenant. It distinguishes itself from retrieval tools by noting the purpose is discovery before querying and names retrieve_evidence as the downstream consumer.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description clearly states when to use the tool: before issuing a query, to discover available content domains. It also tells the agent how to use the returned source_type values with retrieve_evidence. It does not list exclusions or compare against all siblings, but the context is clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

retrieve_evidenceA

Execute evidence retrieval across indexed content.

Parameters:

  • query_text: The natural-language or keyword search query.

  • top_k: Maximum number of ranked evidence chunks to return (default: 10).

  • source_type: Optional filter by source kind (e.g., 'markdown', 'confluence').

  • trace_id: Optional client-supplied correlation ID for audit tracing.

  • tenant_id: Tenant namespace identifier (scopes search to tenant data).

  • mode: Retrieval strategy: 'hybrid' (lexical + vector RRF), 'lexical' (full-text only), or 'vector' (semantic embeddings only).

ParametersJSON Schema
NameRequiredDescriptionDefault
modeNohybrid
top_kNo
trace_idNo
tenant_idNo
query_textYes
source_typeNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description must carry the behavioral disclosure burden. It adds useful behavior-related details about retrieval modes ('hybrid', 'lexical', 'vector') and scoping via tenant_id and source_type. However, it does not explicitly state the operation is read-only, mention auth requirements, or disclose rate limits or side effects, so it is adequate but not comprehensive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact and well structured: a one-sentence purpose statement followed by a scannable parameter list. Every line adds useful information and there is no filler or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexitycars, an output schema exists and parameter semantics are fully documented, so the calling contract is largely complete. The main gap is the absence of guidance on how this tool relates to closely named siblings, but that issue is already reflected in the usage_guidelines score and does not prevent a competent agent from invoking the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0% description coverage, so the description must compensate, and it does thoroughly. All six parameters are explained beyond their bare property names: mode's strategies are expanded, tenant_id is described as scoping search to tenant data, trace_id is tied to audit tracing, source_type gets examples, and top_k is described as returning ranked chunks. This is strong parameter documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a clear action and resource: 'Execute evidence retrieval across indexed content.' However, the sibling set includes get_evidence and explain_retrieval, and the description does not explain how this tool differs from them, so it is clear but lacks sibling differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use retrieve_evidence versus get_evidence, get_document, or explain_retrieval. It only describes the tool's own operation and parameters, with no context about exclusions, prerequisites, or alternative conditions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 8 tool updatesv0.1.1
    • First observedcheck_consistency
    • First observedexplain_retrieval
    • First observedget_document
    • First observedget_evidence
    • First observedget_index_status
    • First observedhealth_check
    • First observedlist_sources
    • First observedretrieve_evidence

TDQS

B3/5.0

Scored across 8 tools

Disambiguation4/5

Most tools have clear boundaries: retrieve_evidence executes search, get_evidence fetches a chunk by ID, get_document likely fetches a full document, and the three diagnostics target different concerns (runtime health, index state, data consistency). Minor ambiguity exists between health_check and get_index_status, and get_document lacks a description, making its boundary with get_evidence less obvious.

Naming Consistency4/5

The set mostly follows a snake_case verb_noun pattern: list_sources, retrieve_evidence, get_document, explain_retrieval, check_consistency. health_check breaks the pattern slightly (noun-like compound instead of check_health), and get_document/get_evidence/get_index_status share the get_ prefix with different objects, which is predictable.

Tool Count5/5

Eight tools is well-scoped for a knowledge-retrieval and diagnostics server: query, evidence/document access, explainability, health, index status, consistency, and source discovery. Each tool serves a distinct operational need without redundancy.

Completeness4/5

The retrieval workflow is covered end-to-end: discover sources, retrieve evidence, fetch specific chunks/documents, explain scoring, and inspect health/index/consistency. Minor gaps are the undocumented get_document behavior and the absence of any listing/management operation beyond sources, though ingestion appears to be handled outside this server.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    C
    maintenance
    A production-minded RAG service for MCP that answers questions over your documents with hybrid retrieval, PII redaction, and source citations, packaged for Docker/Kubernetes.
    -
  • A
    license
    Not graded
    quality
    A
    maintenance
    Provides an evidence-oriented MCP interface for Evidence RAG Pilot, enabling retrieval of evidence packages, chunks, and evidence images from PDF-based corpora.
    1
    Apache 2.0