Skip to content

Anmol202005/ORAG

Repository files navigation

  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—  β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
 β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β•β•
 β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ–ˆβ•—
 β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘
 β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•
  β•šβ•β•β•β•β•β• β•šβ•β•  β•šβ•β•β•šβ•β•  β•šβ•β• β•šβ•β•β•β•β•β•

Your org's knowledge, ready for any model.

Organizational RAG & MCP Platform β€” now in early access.

Live Demo TypeScript Deployed on Vercel AWS DynamoDB React


What is ORAG?

ORAG is an organizational RAG and MCP platform that connects your internal data to AI pipelines β€” with enterprise access controls built in from day one.

Stop duct-taping retrieval pipelines together. ORAG gives your team a single place to index knowledge, expose it via the Model Context Protocol, and manage exactly who can access what β€” all with sub-50ms retrieval and zero infrastructure to babysit.

One config file is all it takes to expose your entire knowledge base as a fully typed MCP server β€” complete with streaming, auth, and observability out of the box.


Key Numbers

Metric Value
Median retrieval latency < 50 ms
Documents indexed per minute 10,000+
Uptime SLA 99.9%
Compliance SOC 2 Type II

Features

πŸ—‚ RAG Pipelines β€” Retrieve what matters

Connect your org's documents, wikis, and databases into a unified retrieval layer. ORAG indexes, chunks, and embeds everything so your models always have the right context.

🌐 MCP Servers β€” One protocol, every tool

Spin up Model Context Protocol servers that give your agents structured, permissioned access to internal APIs, code repos, CRMs, and more β€” without bespoke glue code.

πŸ” Access Control β€” Org-grade permissions

Role-based access across every knowledge base and MCP server. Audit logs, team workspaces, and SSO keep enterprise compliance teams happy.

πŸ“Š Observability β€” Every call, traced

Full request tracing across retrievals, tool calls, and completions. Latency breakdowns, token usage, and retrieval quality scores β€” all in one view.


How It Works

01 β†’ Connect sources      Link Notion, Confluence, S3, GitHub, or any custom data source.
02 β†’ Configure pipelines  Choose chunking strategy, embedding model, and retrieval parameters.
03 β†’ Expose via MCP       Your retrieval layer becomes a typed MCP server your agents can call.
04 β†’ Ship to production   Deploy with one click. Monitor latency and quality from the dashboard.

MCP in Minutes, Not Months

One config block connects Claude, Cursor, or any MCP-compatible agent to your entire organization's knowledge base:

// ~/.claude/claude_code_config.json
{
  "mcpServers": {
    "orag": {
      "type": "http",
      "url": "https://orag.theanmolsharma.com/api/orgs/acme-corp/mcp",
      "headers": {
        "Authorization": "Bearer orag_live_xxxxxxxxxxxxxxxxxxxx"
      }
    }
  }
}

That's it. Your agents now have permissioned, streaming, observable access to everything your org knows.


Tech Stack

Layer Technology
Frontend React 18 Β· TypeScript Β· Vite Β· Framer Motion
Backend Vercel Serverless Functions (TypeScript)
Database AWS DynamoDB β€” single-table design
Auth Google OAuth 2.0 + JWT
Protocol Model Context Protocol (MCP)
Hosting Vercel (zero-config deploys)

Architecture

Single-Table DynamoDB Design

All entities live in one DynamoDB table, keyed by pk + sk:

pk sk Entity
USER#<userId> PROFILE User record
USER#<userId> MEMBER#<orgId> Org membership + role
ORG#<orgId> PROFILE Organization record
SLUG#<slug> ORG Slug β†’ OrgId uniqueness guard

GSI1 β€” EMAIL#<email> β†’ instant email lookup at sign-in
GSI2 β€” PUBLIC_ORGS β†’ sparse index for public org discovery + search

Authentication Flow

Client                             Server
  β”‚                                  β”‚
  │── Google ID Token ─────────────▢ POST /api/auth/google
  β”‚                                  β”œβ”€ Verify with Google
  β”‚                                  β”œβ”€ Lookup via GSI1 (email)
  β”‚                                  β”œβ”€ Create user if new
  │◀── JWT { userId, email, name } ───
  β”‚                                  β”‚
  │── Authorization: Bearer <JWT> ──▢ All subsequent API calls

Composable Middleware

// lib/middleware.ts
compose(withCors, withAuth)(handler)

// withAuth         β†’ requires valid JWT, injects req.user or returns 401
// withOptionalAuth β†’ injects req.user if present, never blocks
// withCors         β†’ CORS headers + OPTIONS preflight

API Reference

Auth

Method Endpoint Description
POST /api/auth/google Verify Google token β†’ return JWT
GET /api/auth/me Current user profile
POST /api/auth/signout Stateless β€” client drops JWT

Organizations

Method Endpoint Description
GET /api/orgs/mine User's orgs (BatchGet)
GET /api/orgs/public Public org discovery, ?search= filter
POST /api/orgs Create org (atomic TransactWrite)
POST /api/orgs/:id/join Join org (memberCount++, race-safe)
GET /api/orgs/:slug Resolve slug β†’ org profile

Getting Started

Prerequisites

  • Node.js 18+
  • AWS account (DynamoDB)
  • Google Cloud project (OAuth 2.0 credentials)

Install

git clone https://github.com/Anmol202005/ORAG.git
cd ORAG
npm install

Environment Variables

GOOGLE_CLIENT_ID=your_google_client_id
JWT_SECRET=your_jwt_secret

AWS_REGION=us-east-1
AWS_ACCESS_KEY_ID=your_key
AWS_SECRET_ACCESS_KEY=your_secret
DYNAMO_TABLE_NAME=your_table

Run Locally

# Frontend only (Vite dev server β†’ localhost:5173)
npm run dev

# Full stack with API
npx vercel dev

Deploy

Push to GitHub β†’ import in the Vercel dashboard β†’ add env vars β†’ done.
The api/ directory is auto-detected as serverless functions. Zero config required.


Project Structure

ORAG/
β”œβ”€β”€ api/                  # Vercel serverless functions
β”‚   β”œβ”€β”€ auth/             #   google.ts Β· me.ts Β· signout.ts
β”‚   └── orgs/             #   mine.ts Β· public.ts Β· [id]/join.ts Β· [slug].ts
β”œβ”€β”€ lib/
β”‚   └── middleware.ts     # withAuth Β· withOptionalAuth Β· withCors Β· compose
β”œβ”€β”€ src/                  # React 18 frontend
β”‚   β”œβ”€β”€ components/
β”‚   └── pages/
β”œβ”€β”€ vercel.json           # Deployment config
β”œβ”€β”€ vite.config.ts
└── DynamoDoc.txt         # Full DB schema reference

Contributing

  1. Fork the repo
  2. git checkout -b feat/your-feature
  3. git commit -m 'feat: your change'
  4. Open a Pull Request

Please run npm run lint before submitting.


β†’ Try ORAG free Β Β·Β  Read the docs

Get your organization's knowledge base production-ready in under an hour. No infrastructure to manage.


Made by Anmol Sharma

About

ORAG is an organizational RAG and MCP platform that connects your internal data to AI pipelines - with enterprise access controls built in from day one.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages