Skip to main content
Glama

AmritaGPT: Institutional Intelligence Infrastructure for the AI-Native University

"One intelligence layer for every document, department, workflow, and AI agent."

AmritaGPT is an enterprise-grade institutional intelligence infrastructure built for Amrita Vishwa Vidyapeetham. It converts the university's heterogeneous, distributed document ecosystem into a governed, searchable, reasoning-ready knowledge layer and exposes it universally through the Model Context Protocol (MCP).


πŸ›οΈ System Architecture

AmritaGPT is structured across 6 core pillars:

                         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                         β”‚           AI USERS & AGENTS             β”‚
                         β”‚  Students β€’ Faculty β€’ Admin β€’ Research  β”‚
                         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                              β”‚
                         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                         β”‚         AMRITAGPT MCP SERVER            β”‚
                         β”‚   Tools β€’ Resources β€’ Prompts β€’ Auth    β”‚
                         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                              β”‚
                         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                         β”‚         HYBRID RETRIEVAL ENGINE         β”‚
                         β”‚                                         β”‚
                         β”‚   Dense Vector (BGE) + BM25 Lexical     β”‚
                         β”‚   Reciprocal Rank Fusion (RRF k=60)     β”‚
                         β”‚   Cross-Feature Precision Reranking     β”‚
                         β”‚   Role-Based Pre-Retrieval ACL          β”‚
                         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                              β”‚
                         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                         β–Ό                                         β–Ό
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β”‚    VECTOR STORE     β”‚                   β”‚     METADATA DB     β”‚
              β”‚  FastEmbed ONNX 384 β”‚                   β”‚   SQLite Relational β”‚
              β”‚  Cosine Similarity  β”‚                   β”‚   ACLs & Lineage    β”‚
              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                              β–²
                                              β”‚
                         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                         β”‚      CONTINUOUS INGESTION PIPELINE      β”‚
                         β”‚                                         β”‚
                         β”‚  PDF (PDFium) β€’ DOCX β€’ XLSX β€’ PPTX      β”‚
                         β”‚  Structure-Aware Semantic Chunking      β”‚
                         β”‚  Contextual Enrichment (Hierarchy/Meta) β”‚
                         β”‚  Checksum Deduplication (Idempotency)   β”‚
                         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Related MCP server: mcp-rag-bridge

πŸš€ Key Architectural Innovations

1. Structure-Aware Semantic Chunking & Contextual Enrichment

Unlike naive fixed-token chunking, AmritaGPT preserves document hierarchy:

  • Contextual Prefixes: Every chunk is prefixed with the institutional path: [Institution: Amrita Vishwa Vidyapeetham] | Dept: Academic Admin Office | Doc: btech-regulations-2023 | Section: R.4 Attendance | Page: 4

  • Semantic Boundaries: Splits occur cleanly on regulation rules, sub-sections, paragraphs, or tabular lines, avoiding split meanings.

  • Neighbor Linking: Chunks maintain prev_chunk_id and next_chunk_id pointers for dynamic context expansion during retrieval.

2. Multi-Stage Hybrid Retrieval

  • Dense Vector Search: Powered by BAAI/bge-small-en-v1.5 running on local ONNX runtime for conceptual matching.

  • Sparse Lexical Search: Powered by rank_bm25 for exact regulation codes (e.g. R.4, R.14), course numbers (e.g. 23CSE101), and faculty names.

  • Reciprocal Rank Fusion (RRF): $$RRF(d) = \sum_{m \in {dense, bm25}} \frac{1}{k + rank_m(d)} \quad (k=60)$$

  • Precision Cross-Feature Reranking: Evaluates query-passage cross-alignment, heading bonuses, exact identifier matches, and temporal freshness.

3. Institutional Access Control (RBAC) & Security

  • Pre-Retrieval Filtering: Enforces role boundaries (public < student < faculty < admin) before candidates are searched, preventing unauthorized information leakage.

  • Prompt Injection Defense: All retrieved documents are sanitized and treated strictly as untrusted data, preventing adversarial instruction override.

4. Grounded Generation & Citation Engine

  • Evidence-Bound Policy: If sufficient evidence exists, answers are constructed with inline citations [Document, Section, Page, Year]. If evidence is insufficient, the system safely returns:

    "I couldn't find sufficient evidence in the institutional knowledge base."

  • Grounding Verifier: Automatically audits generated claims against retrieved evidence, computing a factual grounding score.


πŸ› οΈ MCP Capabilities

AmritaGPT implements the official Model Context Protocol specification:

MCP Tools (Actions)

Tool

Description

search_knowledge

Multi-stage hybrid search across institutional knowledge with access filtering.

search_documents

Search the document catalog by title, department, or category.

get_document

Read full metadata, section list, and content of an institutional document.

get_document_section

Read a specific section, regulation clause, or table from a document.

search_policy

Dedicated search for university policies, disciplinary rules, and guidelines.

search_academic_regulations

Search official B.Tech/M.Tech/PhD ordinances and attendance rules.

get_latest_circular

Retrieve recent notifications, circulars, and calendar dates.

compare_document_versions

Compare two document versions to audit curriculum or policy changes.

find_related_documents

Discover companion files within the same department or academic program.

ask_institutional_question

End-to-end grounded RAG answer generation with verified citations.

get_system_stats

Real-time observability: total documents, chunks, queries, and latency.

run_rag_evaluation

Run automated benchmark suite measuring Recall@1, Recall@5, and MRR.

MCP Resources (Knowledge Objects)

  • amritagpt://system/stats: Live system health, document count, and index status.

  • amritagpt://policies/current: Summary of currently active university regulations.

  • amritagpt://departments/list: Catalog of university departments and repository sizes.

MCP Prompts (Reusable Agent Workflows)

  • academic_advising: Guide students through curriculum, prerequisites, and graduation requirements.

  • policy_compliance_check: Audit scenarios against institutional and examination rules.


🌐 OpenAPI 3.1 REST API Gateway

AmritaGPT is 100% OpenAPI 3.1 compliant and exposes an interactive REST API alongside its MCP capabilities:

  • Interactive Swagger UI: http://localhost:8000/docs

  • ReDoc Interactive Documentation: http://localhost:8000/redoc

  • OpenAPI 3.1 JSON Specification: http://localhost:8000/openapi.json (also exported to openapi.json)

  • OpenAPI YAML Specification: openapi.yaml

  • Integrated MCP SSE Endpoint: http://localhost:8000/mcp/sse

REST Endpoints Reference

Method

Path

Description

GET

/

API identity, documentation links, and MCP SSE endpoint.

GET

/health

Index health check (documents, chunks, vector/BM25 status).

POST

/api/v1/search/knowledge

Hybrid search (Dense Vector + BM25 + RRF + Reranker) with access filtering.

POST

/api/v1/qa/ask

End-to-end grounded generation with citations and grounding confidence.

POST

/api/v1/policy/search

Search university policies, disciplinary rules, and guidelines.

POST

/api/v1/regulations/academic

Search official B.Tech/M.Tech/PhD ordinances & attendance rules.

POST

/api/v1/search/documents

Search the document catalog by title, department, or keywords.

GET

/api/v1/documents/{document_id}

Retrieve full metadata and sections of an institutional document.

POST

/api/v1/documents/compare

Compare two document versions to detect policy/curriculum revisions.

GET

/api/v1/system/stats

Observability metrics (total documents, chunks, query latency).

POST

/api/v1/evaluation/run

Run automated RAG evaluation benchmark suite.


πŸ“‚ Project Structure

C:\Users\Suz Machine Tech\RAG\
β”œβ”€β”€ amritagpt/
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ config.py                 # System configurations and paths
β”‚   β”œβ”€β”€ api/
β”‚   β”‚   β”œβ”€β”€ __init__.py
β”‚   β”‚   β”œβ”€β”€ app.py                # FastAPI OpenAPI REST Gateway with mounted MCP
β”‚   β”‚   └── schemas.py            # Pydantic schemas for all requests/responses
β”‚   β”œβ”€β”€ ingestion/
β”‚   β”‚   β”œβ”€β”€ parser.py             # Format-agnostic parser (PDF, DOCX, XLSX, PPTX)
β”‚   β”‚   β”œβ”€β”€ chunker.py            # Structure-aware semantic chunker
β”‚   β”‚   └── pipeline.py           # Ingestion bus with checksum deduplication
β”‚   β”œβ”€β”€ indexing/
β”‚   β”‚   β”œβ”€β”€ vector_store.py       # Dense vector index (FastEmbed ONNX 384-dim)
β”‚   β”‚   β”œβ”€β”€ bm25_store.py         # BM25 sparse lexical index
β”‚   β”‚   └── metadata_store.py     # SQLite relational metadata database
β”‚   β”œβ”€β”€ retrieval/
β”‚   β”‚   β”œβ”€β”€ query_analyzer.py     # Intent detection, entity extraction, temporal logic
β”‚   β”‚   β”œβ”€β”€ hybrid_search.py      # Hybrid Dense + BM25 search with RRF
β”‚   β”‚   β”œβ”€β”€ reranker.py           # Precision cross-feature reranker
β”‚   β”‚   └── context_assembler.py  # Evidence packager and neighbor expansion
β”‚   β”œβ”€β”€ generator/
β”‚   β”‚   β”œβ”€β”€ grounded_engine.py    # Grounded response synthesis
β”‚   β”‚   β”œβ”€β”€ citation_engine.py    # Provenance and citation formatting
β”‚   β”‚   └── verifier.py           # Grounding and hallucination auditor
β”‚   β”œβ”€β”€ security/
β”‚   β”‚   └── access_control.py     # Role-based ACL & prompt injection guard
β”‚   β”œβ”€β”€ observability/
β”‚   β”‚   └── telemetry.py          # Metrics, query audit logs, evaluation framework
β”‚   └── mcp/
β”‚       └── server.py             # MCPServer exposing tools, resources, prompts
β”œβ”€β”€ data/                         # Institutional documents directory (316 files)
β”œβ”€β”€ storage/                      # SQLite DB, vector embeddings, BM25 indices
β”œβ”€β”€ scripts/
β”‚   β”œβ”€β”€ ingest_all.py             # CLI runner for document ingestion
β”‚   β”œβ”€β”€ export_openapi.py         # Export openapi.json and openapi.yaml
β”‚   β”œβ”€β”€ test_mcp_client.py        # End-to-end MCP verification suite
β”‚   └── test_openapi_client.py    # End-to-end OpenAPI REST verification suite
β”œβ”€β”€ openapi.json                  # Exported OpenAPI 3.1 JSON Specification
β”œβ”€β”€ openapi.yaml                  # Exported OpenAPI 3.1 YAML Specification
β”œβ”€β”€ mcp_config.json               # MCP client configuration template
β”œβ”€β”€ run_server.py                 # Unified server entry point (MCP & OpenAPI)
└── README.md

⚑ Quick Start

1. Ingest Institutional Documents

python scripts/ingest_all.py

2. Run Verification Suites

# Run MCP Verification Suite
python scripts/test_mcp_client.py

# Run OpenAPI REST API Verification Suite
python scripts/test_openapi_client.py

3. Start AmritaGPT Server

Option A: OpenAPI REST Gateway & Swagger UI (Port 8000)

python run_server.py --mode api --port 8000

Then visit:

Option B: Standard MCP Stdio Server (for Claude Desktop / Cursor / Antigravity)

python run_server.py --mode mcp --transport stdio

4. Configure in Claude Desktop / Cursor / Antigravity

Add the following to your claude_desktop_config.json or MCP settings:

{
  "mcpServers": {
    "amritagpt": {
      "command": "python",
      "args": [
        "path/to/run_server.py",
        "--mode",
        "mcp",
        "--transport",
        "stdio"
      ],
      "env": {
        "PYTHONIOENCODING": "utf-8"
      }
    }
  }
}

Tool Schema Changelog

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

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to search, deep-read, and build knowledge bases from Markdown, PDF, DOCX, and PPTX documents via MCP tools for retrieval, document navigation, and ingestion.
      15 npm
      653
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to query and manage a document knowledge base via MCP, with RAG-powered search and grounded answers with citations.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables MCP-capable AI assistants to browse, search, and retrieve cited, trust-aware answers from enterprise documents by converting them into a searchable knowledge base with provenance.
      Apache 2.0