You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We propose introducing a dedicated RESTHeart Repository Connector (oc-restheart-repository-connector) module to support RESTHeart the open-source Web API server for MongoDB and HTTP microservices as a native enterprise data source for OpenCrawling.
Adding native support for RESTHeart allows organizations using RESTHeart to expose MongoDB collections, document databases, GridFS binary files, and microservice APIs to seamlessly crawl, index, vector-embed, and secure JSON documents and attachments into downstream Vector Search, RAG pipelines, and Model Context Protocol (MCP) AI Agents.
🎯 Motivation & Enterprise Use Case
RESTHeart by SoftInstigate is a widely adopted open-source framework that instantly turns MongoDB databases and microservices into secure REST, GraphQL, and WebSocket APIs.
Enterprises rely on RESTHeart for:
JSON Document Storage & Microservices: Storing multi-structured domain entities, customer records, audit logs, and catalog items in MongoDB collections exposed over HTTP REST APIs.
GridFS Binary Attachments: Serving large files, PDF reports, images, and media blobs stored in MongoDB GridFS buckets via RESTHeart's RESTful file endpoints.
Built-in Security & RBAC: Enforcing fine-grained Access Control Lists (ACLs), Role-Based Access Control (RBAC), and JWT / Basic / API-Key authentication at the database and collection levels.
Change Streams & Real-time WebSockets: Emitting real-time document mutation events whenever documents are inserted, updated, or deleted.
However, when enterprise AI applications deploy Retrieval-Augmented Generation (RAG), documents stored within RESTHeart/MongoDB collections often remain isolated. By introducing oc-restheart-repository-connector, OpenCrawling can incrementally scan RESTHeart collections, extract raw JSON payloads and GridFS attachments, map native RESTHeart ACL security rules into Open Ingestion Standard (OIS) headers, and stream vector embeddings to vector databases with zero-trust identity security.
💡 Proposed Architecture & Data Pipeline
graph TD
subgraph RESTHeart API & MongoDB Store
RH[RESTHeart Web API Server]
MongoDB[(MongoDB Collections / GridFS Buckets)]
Sec[RESTHeart Security Engine - RBAC / ACLs]
RH --> MongoDB
RH --> Sec
end
subgraph OpenCrawling Ingestion Pipeline
Connector[oc-restheart-repository-connector]
Connector -->|1. Authenticate & Page REST Collections / GridFS| RH
Connector -->|2. Fetch Document JSON & Binary Streams| RH
Connector -->|3. Extract Roles & User ACLs| Sec
Core[oc-core Pipeline - Tika & TokenTextSplitter]
Kafka[Apache Kafka - Topic: raw-documents]
Connector -->|4. Emit OIS RepositoryDocuments + ACL Metadata| Core
Core -->|5. Publish Document Chunks| Kafka
end
subgraph Embedding & Vector Target
Embed[Spring AI / EmbeddingModel - Ollama / OpenAI]
VectorStore[(Vector Store - pgvector / Qdrant / ES)]
Kafka --> Embed
Embed -->|6. Store Embeddings + ACL Metadata| VectorStore
end
subgraph AI Retrieval / RAG
MCP[OpenCrawling Secure MCP Server]
LLM[LLM Agent / RAG Pipeline]
LLM -->|7. Query MCP with User Identity| MCP
MCP -->|8. Filtered Vector Search via OIS ACLs| VectorStore
end
Implement RepositoryConnector interface from oc-core.
Annotate with @Component and @ConditionalOnProperty(name = "opencrawling.connector.restheart.enabled", havingValue = "true").
Execute collection scans leveraging Java 25 Virtual Threads and StructuredTaskScope for concurrent batch fetching across databases, collections, and GridFS buckets.
Key Crawling Strategies:
Full Collection Scan: Pages through collections using RESTHeart pagination headers and query parameters (GET /{db}/{coll}?page=1&pagesize=100&sort={"_etag":1}).
Incremental Crawling via _etag / _lastModified: Filters updated documents using RESTHeart filter syntax (GET /{db}/{coll}?filter={"_etag":{"$gt":{"$oid":"..."}}}).
GridFS File Ingestion: Detects GridFS file collections (*.files) and fetches binary file contents via RESTHeart binary endpoints (GET /{db}/{bucket}/{file_id}) for Apache Tika text & metadata extraction.
Change Stream Ingestion: Connects to RESTHeart WebSocket / Change Stream endpoints (GET /{db}/{coll}/_changes) for real-time document mutation streaming.
RESTHeart provides role-based and permission-based security. The connector will automatically extract document and collection-level permission rules and translate them into Open Ingestion Standard (OIS) ACL headers:
📄 Summary
We propose introducing a dedicated RESTHeart Repository Connector (
oc-restheart-repository-connector) module to support RESTHeart the open-source Web API server for MongoDB and HTTP microservices as a native enterprise data source for OpenCrawling.Adding native support for RESTHeart allows organizations using RESTHeart to expose MongoDB collections, document databases, GridFS binary files, and microservice APIs to seamlessly crawl, index, vector-embed, and secure JSON documents and attachments into downstream Vector Search, RAG pipelines, and Model Context Protocol (MCP) AI Agents.
🎯 Motivation & Enterprise Use Case
RESTHeart by SoftInstigate is a widely adopted open-source framework that instantly turns MongoDB databases and microservices into secure REST, GraphQL, and WebSocket APIs.
Enterprises rely on RESTHeart for:
However, when enterprise AI applications deploy Retrieval-Augmented Generation (RAG), documents stored within RESTHeart/MongoDB collections often remain isolated. By introducing
oc-restheart-repository-connector, OpenCrawling can incrementally scan RESTHeart collections, extract raw JSON payloads and GridFS attachments, map native RESTHeart ACL security rules into Open Ingestion Standard (OIS) headers, and stream vector embeddings to vector databases with zero-trust identity security.💡 Proposed Architecture & Data Pipeline
graph TD subgraph RESTHeart API & MongoDB Store RH[RESTHeart Web API Server] MongoDB[(MongoDB Collections / GridFS Buckets)] Sec[RESTHeart Security Engine - RBAC / ACLs] RH --> MongoDB RH --> Sec end subgraph OpenCrawling Ingestion Pipeline Connector[oc-restheart-repository-connector] Connector -->|1. Authenticate & Page REST Collections / GridFS| RH Connector -->|2. Fetch Document JSON & Binary Streams| RH Connector -->|3. Extract Roles & User ACLs| Sec Core[oc-core Pipeline - Tika & TokenTextSplitter] Kafka[Apache Kafka - Topic: raw-documents] Connector -->|4. Emit OIS RepositoryDocuments + ACL Metadata| Core Core -->|5. Publish Document Chunks| Kafka end subgraph Embedding & Vector Target Embed[Spring AI / EmbeddingModel - Ollama / OpenAI] VectorStore[(Vector Store - pgvector / Qdrant / ES)] Kafka --> Embed Embed -->|6. Store Embeddings + ACL Metadata| VectorStore end subgraph AI Retrieval / RAG MCP[OpenCrawling Secure MCP Server] LLM[LLM Agent / RAG Pipeline] LLM -->|7. Query MCP with User Identity| MCP MCP -->|8. Filtered Vector Search via OIS ACLs| VectorStore end🏛️ Implementation Details & Specifications
1. Maven Module (
oc-restheart-repository-connector)Create a new Maven sub-module
oc-restheart-repository-connectorwithin the OpenCrawling project structure:2. Core Repository Connector Implementation (
RestheartRepositoryConnector.java)RepositoryConnectorinterface fromoc-core.@Componentand@ConditionalOnProperty(name = "opencrawling.connector.restheart.enabled", havingValue = "true").StructuredTaskScopefor concurrent batch fetching across databases, collections, and GridFS buckets.Key Crawling Strategies:
GET /{db}/{coll}?page=1&pagesize=100&sort={"_etag":1})._etag/_lastModified: Filters updated documents using RESTHeart filter syntax (GET /{db}/{coll}?filter={"_etag":{"$gt":{"$oid":"..."}}}).*.files) and fetches binary file contents via RESTHeart binary endpoints (GET /{db}/{bucket}/{file_id}) for Apache Tika text & metadata extraction.GET /{db}/{coll}/_changes) for real-time document mutation streaming.3. Security & ACL Mapping (
RestheartAclExtractor.java)RESTHeart provides role-based and permission-based security. The connector will automatically extract document and collection-level permission rules and translate them into Open Ingestion Standard (OIS) ACL headers:
4. Configuration Schema (
application.yml)🧪 Acceptance Criteria
oc-restheart-repository-connectoradded to parentpom.xml.RestheartRepositoryConnectorsupporting RESTHeart REST APIs (documents, collections, GridFS files)._etag/_lastModifiedtimestamps.RestheartAclExtractorto map RESTHeart roles and permissions to OIS ACL headers.softinstigate/restheartandmongocontainer images).opencrawling.github.io.📌 References