Skip to main content
Glama
Enesp4rl4k

enterprise-knowledge-integrator

by Enesp4rl4k

🧠 Enterprise Knowledge Integrator

Connect Corporate Private Data (PDF, Excel, Word, SQL) to LLMs & AI Agents with Built-in PII Sanitization, Hybrid Search & MCP Server.

License: MIT Python 3.9+ FastAPI Model Context Protocol PRs Welcome

Live Dashboard β€’ Quickstart β€’ MCP Server Setup β€’ Architecture β€’ API Reference


🌟 Why Enterprise Knowledge Integrator?

Enterprises have fragmented knowledge across PDF policy documents, Excel/CSV financial models, contracts, and ERP notes. Feeding this data directly into LLMs often leads to PII leakage, hallucinations on numbers, and context loss.

Enterprise Knowledge Integrator is an open-source, lightweight, plug-and-play middleware that turns your company's raw files into clean, cited, and secure context for any LLM or AI Agent.


Related MCP server: MCP RAG Server

✨ Key Features

  • πŸ“„ Tabular-Aware ETL (Excel & CSV): Converts spreadsheet rows into markdown tables and semantic row groups so LLMs never hallucinate row numbers or formulas.

  • πŸ›‘οΈ Built-in PII & Secret Sanitizer: Automatically detects and masks TCKN, IBANs, Credit Cards, Tax IDs (VKN), phone numbers, and API keys before embedding or prompt injection.

  • ⚑ Hybrid Retrieval (Vector + Okapi BM25 + RRF): Blends dense embeddings with sparse keyword matching using Reciprocal Rank Fusion (RRF) for 100% accuracy on financial codes and numbers.

  • πŸ‘₯ Role-Based Access Control (RBAC): Enforces document clearance levels (Public, Internal, Confidential, Restricted) and department filtering.

  • πŸ” Citation & Hallucination Validator: Automatically checks generated LLM answers against source documents and calculates a confidence score.

  • πŸ”„ Directory Auto-Watcher: Monitors your folders/cloud drive mounts and automatically re-indexes added or modified files.

  • πŸ”Œ Universal Gateways:

    • Model Context Protocol (MCP) for Cursor, Claude Desktop, Antigravity.

    • FastAPI REST API with Swagger UI.

    • Interactive Web Dashboard (Zero extra dependencies required).

    • LangChain / LangGraph Tool Adapter.


πŸ›οΈ System Architecture

graph TD
    subgraph Ingestion ["1. Multi-Source Ingestion & ETL"]
        F1["πŸ“„ Documents (PDF, Word, Markdown)"]
        F2["πŸ“Š Tabular (Excel, CSV)"]
        F3["πŸ—„οΈ Notes & Text Snippets"]
        F1 & F2 & F3 --> PII["πŸ›‘οΈ PII Masker (TCKN, IBAN, Cards)"]
        PII --> Chunk["βœ‚οΈ Semantic & Parent-Child Chunker"]
    end

    subgraph Storage ["2. Storage & Hybrid Search Engine"]
        Chunk --> V["V-Store: Cosine Dense Embeddings"]
        Chunk --> B["BM25: Sparse Keyword Index"]
        V & B --> RRF["🎯 Reciprocal Rank Fusion (RRF)"]
    end

    subgraph Governance ["3. Security & Governance"]
        RRF --> RBAC["πŸ‘₯ RBAC & Clearance Filter"]
        RBAC --> Val["πŸ” Citation & Grounding Validator"]
    end

    subgraph Interfaces ["4. LLM & Agent Gateways"]
        Val --> MCP["⚑ MCP Server (Claude Desktop / Cursor)"]
        Val --> API["🌐 FastAPI REST API (/api/v1/context)"]
        Val --> UI["πŸ–₯️ Modern Web Dashboard (/dashboard)"]
        Val --> SDK["πŸ’Ό LangChain / LangGraph Adapter"]
    end

⚑ Quickstart in 60 Seconds

1. Installation

git clone https://github.com/your-username/enterprise-knowledge-integrator.git
cd enterprise-knowledge-integrator
pip install -r requirements.txt

2. Launch the Web Dashboard & API

python -m knowledge_integrator.interfaces.api.app

Open your browser at http://localhost:8088/dashboard to access the visual control panel.


πŸ’» CLI Usage

Ingest a Text / Policy Note:

python -m knowledge_integrator.interfaces.cli.main ingest-text \
  --title "2025 Travel Policy" \
  --content "Daily travel allowance is 2,500 TL. Stays above 5,000 TL require CFO approval." \
  --category "policy"

Ingest Files or Directories (PDF, Excel, CSV, Word, Markdown):

python -m knowledge_integrator.interfaces.cli.main ingest ./company_docs/ --category "finance"

Search Knowledge Base:

python -m knowledge_integrator.interfaces.cli.main query "What is the travel budget limit?"

List Indexed Documents:

python -m knowledge_integrator.interfaces.cli.main list

⚑ Model Context Protocol (MCP) Server

Connect your corporate knowledge directly into Claude Desktop, Cursor IDE, or Antigravity.

Add this to your claude_desktop_config.json or cursor settings:

{
  "mcpServers": {
    "company-knowledge": {
      "command": "python",
      "args": ["-m", "knowledge_integrator.interfaces.cli.main", "serve-mcp"]
    }
  }
}

Available MCP Tools:

  • search_company_knowledge: Performs hybrid search on private company documents.

  • get_company_context: Returns clean, cited context ready for prompt injection.

  • list_company_documents: Lists all indexed sources and metadata.

  • ingest_company_note: Dynamically saves a new policy or knowledge snippet.


🌐 REST API Reference

Method

Endpoint

Description

POST

/api/v1/ingest/file

Upload & index file (PDF, Excel, CSV, Word, MD)

POST

/api/v1/ingest/text

Ingest raw corporate note or rule

POST

/api/v1/context

Get cited LLM-ready context block

POST

/api/v1/search

Search ranked chunks (Hybrid)

GET

/api/v1/documents

List all indexed documents

DELETE

/api/v1/documents/{id}

Delete document and all associated embeddings

Interactive Swagger documentation available at: http://localhost:8088/docs


πŸ€– Python & LangChain / LangGraph Integration

from knowledge_integrator import KnowledgeEngine
from knowledge_integrator.agentic_cfo_adapter import AgenticCFOKnowledgeAdapter

# 1. Initialize engine
engine = KnowledgeEngine()

# 2. Ingest document
engine.ingest_file("budget_2025.xlsx", category="finance")

# 3. Retrieve LLM context
ctx = engine.get_context_for_llm("What was the Q3 software budget?")
print(ctx.context_text)

# 4. Use as a LangChain / LangGraph Tool for AI Agents
adapter = AgenticCFOKnowledgeAdapter(engine)
agent_tool = adapter.as_langchain_tool()

🐳 Docker Deployment

docker-compose up -d

πŸ§ͺ Running Tests

python -m pytest knowledge_integrator/tests/ -v

πŸ“„ License

This project is licensed under the MIT License β€” see the LICENSE file for details.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables querying enterprise documents (DOCX, PDF, PPTX) using natural language, with hybrid search and MCP integration for Claude Desktop and other agents.
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables document ingestion, semantic search, and retrieval-augmented generation via MCP tools and REST API, using vector embeddings and intelligent chunking.
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Provides a self-hosted knowledge index with document-level permissions, enabling AI agents to retrieve exactly the documents they are authorized to see via MCP. Supports OAuth 2.1, custom embedding models, and runs inside your network.
    38 npm
    1
    Apache 2.0
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables AI agents to query and manage a document knowledge base via MCP, with RAG-powered search and grounded answers with citations.
    MIT