Skip to main content
Glama

Multimodal RAG Service

Production-minded retrieval for text, tables, images, and PDFs. Sentence-transformer text vectors and CLIP image vectors are stored in separate FAISS indexes; BM25 sparse results are combined using weighted reciprocal-rank fusion.

Run locally

python -m venv .venv
.venv\\Scripts\\Activate.ps1
pip install -e ".[dev]"
Copy-Item .env.example .env
uvicorn app.main:app --reload

The API documentation is available at http://localhost:8000/docs. Models download automatically at their first embedding request.

Related MCP server: mcp-rag-agent

API

curl -F "files=@report.pdf" http://localhost:8000/v1/documents
curl -X POST http://localhost:8000/v1/search -H "Content-Type: application/json" -d "{\"query\":\"revenue trend\",\"top_k\":5}"
curl -N -X POST http://localhost:8000/v1/chat/stream -H "Content-Type: application/json" -d "{\"query\":\"Summarize the report\"}"

MCP integration

Run the REST API, then start the stdio MCP bridge:

rag-mcp

Set RAG_API_URL to point at a non-default API address. The bridge provides search_knowledge_base, ask_knowledge_base, list_documents, and service_health tools to MCP clients.

Evaluation

Supply JSONL rows containing query, relevant_document_ids, and optionally reference_answer:

python -m app.evaluation --dataset eval/golden.jsonl

Reported metrics include Recall@K, Precision@K, MRR, p50/p95 retrieval latency, ROUGE-L, and BLEU-1.

Container deployment

docker compose up --build

The compose configuration mounts a persistent named volume at /service/data.

Available Tools

4 tools
ask_knowledge_baseB

Answer a question from the knowledge base and return its source citations.

ParametersJSON Schema
NameRequiredDescriptionDefault
top_kNo
questionYes

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 full burden. It does mention that the tool returns source citations, which is helpful. However, it does not disclose whether the operation is read-only, what happens if no answer is found, or any potential side effects. The transparency is moderate but incomplete.

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, concise sentence that directly conveys the primary purpose and output. There is no redundant information, and it is well-structured for quick understanding.

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 description mentions the output (source citations) but omits important operational context such as error handling, expected behavior when no answer exists, or the role of top_k. Since there is no output schema, the description is not required to detail return fields, but the lack of parameter explanation and behavioral details leaves room for ambiguity.

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?

The schema provides only titles ('Question', 'Top K') and no descriptions. The tool description does not elaborate on the parameters or their expected values. There is no explanation of what 'top_k' controls or how it affects the answer. The schema coverage is 0%, and the description adds no clarification.

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 clearly states the tool's function: answering a question from the knowledge base and returning source citations. It uses a specific verb ('answer') and resource ('knowledge base'), and the output is specified as citations, which distinguishes it from a generic search.

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 does not provide any guidance on when to use this tool versus the sibling search_knowledge_base. It does not explicitly state that this tool should be used when a direct answer with citations is needed, nor does it mention conditions or alternatives. Users must infer the distinction.

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

list_documentsA

List all documents currently indexed by the RAG service.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.8/5.0
Behavior2/5

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

No annotations are provided, so the description must convey behavioral traits on its own. It does not mention whether the operation is read-only, potential performance implications of listing 'all' documents, pagination, sorting, or any side effects. The description is overly minimal for full transparency.

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, concise sentence that leads with the verb and object. It contains no filler or redundant information, making it efficiently structured and easy to parse.

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 that an output schema exists (as indicated), the description need not detail return values. It adequately communicates the tool's scope. Minor gaps remain, such as lack of mention of pagination or sorting, but these are not critical for a list operation and are likely covered by the output schema.

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?

With zero parameters, the baseline score is 4. There are no parameter semantics to describe, and the description correctly avoids inventing any. It adds no meaning beyond the schema because there is nothing to explain.

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 clearly states the action ('List') and the resource ('all documents currently indexed by the RAG service'), making its purpose unambiguous. It distinguishes itself from siblings: search_knowledge_base for searching, ask_knowledge_base for querying, and service_health for health checks.

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 description implies usage by stating what it lists, but it does not explicitly say when to use this tool over alternatives. There is no mention of conditions or exclusions, leaving the decision to inference rather than direct guidance.

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

search_knowledge_baseA

Search text, tables, and images in the indexed knowledge base, returning grounded chunks.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYes
top_kNo
modalityNo

TDQS

A3.6/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses the main behavior (returns grounded chunks) but does not mention read-only nature, potential side effects, or error/limit behavior. 'Search' implies non-destructive, but this is not explicit.

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 concise sentence with no redundant information. It directly states the action, target, and output type.

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 description communicates the core function and output (grounded chunks) but lacks context on when to use it relative to siblings, output size limits, or query formatting. It is adequate for a simple search but not fully complete.

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

Parameters2/5

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

Schema coverage by the description is 0% – no parameters are referenced. The mention of 'text, tables, and images' hints at modality but does not explain query, top_k, or valid modality values. The description fails to compensate for the schema's lack of detail.

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 'Search text, tables, and images in the indexed knowledge base, returning grounded chunks' uses a specific verb (search), identifies the resource (indexed knowledge base), and clearly differentiates from siblings like ask_knowledge_base (which implies answering) and list_documents (which implies enumeration).

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 description implies usage (searching for relevant chunks) but does not explicitly state when to prefer this tool over ask_knowledge_base or list_documents. No alternative conditions are provided.

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

service_healthA

Check whether the linked RAG API is available and return index counts.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.1/5.0
Behavior3/5

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

No annotations are provided, so the description carries full burden. It states what the tool does but does not disclose error behavior, side effects, or the exact meaning of 'available'. This is acceptable for a simple health check but leaves some behavioral details unspecified.

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, clear sentence with no redundant words. It efficiently communicates the tool's purpose and output.

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 no input parameters and no output schema, the description is complete. It specifies the action (check availability) and the return value (index counts), sufficient for an agent to invoke it correctly.

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?

The schema has zero parameters, so description coverage of parameters is trivially complete. With no parameters, the description cannot add meaning beyond the schema, justifying the baseline score.

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 clearly states the tool's function: check availability of the linked RAG API and return index counts. The verb 'check' and 'return' specify actions, and the resource is explicit. It distinguishes from sibling tools (search, ask, list) by focusing on service health rather than content operations.

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 purpose implies when to use it (to verify service availability and get index counts), and its differentiation from siblings is clear. However, it does not explicitly mention alternatives or conditions for selection, so it falls short of fully explicit guidance.

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. 4 tool updatesv0.1.0
    • First observedask_knowledge_base
    • First observedlist_documents
    • First observedsearch_knowledge_base
    • First observedservice_health

TDQS

A3.8/5.0

Scored across 4 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: searching returns chunks, asking returns an answer with citations, listing documents provides an index, and health checks API availability. No overlap or ambiguity.

Naming Consistency4/5

Most tools follow a verb_noun pattern (search_knowledge_base, ask_knowledge_base, list_documents), but service_health breaks the pattern by using a noun phrase. The naming is still clear and consistent in snake_case.

Tool Count5/5

With only 4 tools, the server is tightly scoped for a RAG query service. Each tool is essential and there is no bloat or redundancy.

Completeness4/5

The core query workflow (search, ask, list) is covered, and health monitoring is included. However, there is no tool to add or remove documents, which may be a gap if the server is expected to manage the index, but it might be intentionally read-only.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    C
    maintenance
    Exposes an existing RAG API as MCP tools, enabling health checks and document-based question answering with source evidence.
    -
  • 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.
    -