Project
Recall-OS
RecallOS is an AI-native enterprise knowledge operating system that allows organizations to ingest, organize, search and reason over every piece of company knowledge.
โจ What is RecallOS?

A multimodal memory architecture for persistent retrieval over heterogeneous enterprise knowledge. Upload PDFs, images, audio, and video โ then chat with an AI that cites its sources.
๐ Core Features
| Feature | Description |
|---|---|
| ๐ Multi-modality upload | PDF, images, audio, video via MinIO presigned URLs |
| ๐ญ Modality-aware ingestion | Per-modality parser workers dispatched by MIME type |
| ๐งฉ Decoupled embedding | Modality-agnostic dense + sparse embed, re-embeddable without reparsing |
| ๐ Hybrid search | Dense BGE + sparse SPLADE in Qdrant, fused with RRF |
| ๐ฏ Cross-encoder rerank | Top chunks reranked before LLM context injection |
| ๐ฌ Streaming chat | SSE streaming with source chunk citations + optional modality filter |
| ๐ Web research agent | /web prefix triggers LangGraph loop (Exa โ reason โ refine โ answer) |
| ๐ Projects | Organize chats with custom system prompts |
| ๐ Chat history | Pin, delete, version (edit/resend), and rolling conversation summaries |
| ๐ Langfuse tracing | Full observability for chat RAG and ingestion pipelines |
| ๐ Dead Letter Queue | Failed document processing with retry and reprocessing |
| ๐๏ธ Modular chat UI | 14-file component architecture with custom hooks and focused modules |
๐ ๏ธ Tech Stack
| Layer | Technology |
|---|---|
| ๐ฆ Monorepo | Bun workspaces + Turborepo |
| ๐ฅ๏ธ Frontend | Next.js 16 (App Router), React 19, Tailwind CSS v4 |
| โ๏ธ Backend | Express 5 (JWT middleware on all routes except auth) |
| โก Runtime | Bun |
| ๐ Auth | JWT + bcrypt |
| ๐จ Queue | Redis Streams (consumer groups, XAUTOCLAIM) |
| ๐๏ธ Object storage | MinIO (S3 API) |
| ๐ Metadata | PostgreSQL + Prisma 7 |
| ๐งญ Vectors | Qdrant (dense + sparse named vectors) |
| ๐ Dense embeddings | BGE-small-en (fastembed) |
| ๐ค Sparse embeddings | SPLADE++ EN v1 (fastembed) |
| ๐ฏ Rerank | Hugging Face cross-encoder (ms-marco-MiniLM-L6-v2) |
| ๐ Parsing | LlamaParse (LlamaCloud) |
| ๐ค LLM | OpenRouter |
| ๐ Web search | Exa + LangGraph agent |
| ๐ญ Observability | Langfuse (OpenTelemetry) |
๐๏ธ Architecture
โโโโโโโโโโโโโโ presigned PUT โโโโโโโโโโ
โ Next.js โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโถ โ MinIO โ
โ web โ โ(assets)โ
โโโโโโโฌโโโโโโโ โโโโโฌโโโโโ
โ โ
โ REST (JWT) โ object key
โผ โ
โโโโโโโฌโโโโโโโ xAdd to files_stream โโโโโโผโโโโโโ
โ Express โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโถ โ Redis โ
โ backend โ โ Streams โ
โโโโโโโฌโโโโโโโ โโโโโฌโโโโโโโ
โ โ
โ hybrid query + chat โ Dispatcher
โ โ (routes by MIME)
โผ โผ
โโโโโโโโโโโโโ โโโโโโโโโฌโโโโโโโโโ
โ Qdrant โ โ pdf_stream โ
โ dense + โ โโโโ embed_stream โ image_stream โ
โ splade โ โ audio_stream โ
โโโโโโโโโโโโโ embedding worker โ video_stream โ
โโโโโโโโโฌโโโโโโโโโ
โ โ
โ โโโโโโโโโโโโโ โ
โโโโโโโโโโโโถ โ Postgres โ โโโโโโโโโโโโโโโโ
โ + users โ Parser workers
โ + docs โ (per modality)
โ + chunks โ
โ + chats โ
โโโโโโโโโโโโโ
๐ Ingestion Pipeline
Documents of any modality are accepted (PDF, images, audio, video).
โโโโโโโโ presigned URL โโโโโโโโโ bytes โโโโโโโโโ
โClientโ โโโโโโโโโโโโโโโโโโถ โExpressโ โโโโโโโโโโโโโถ โ MinIO โ
โโโโฌโโโโ โโโโโฌโโโโ โโโโโโโโโ
โ โ
โ POST /confirm โ
โผ โผ
โโโโโโโโโโโโ xAdd โโโโโโโโโโโโโโโโ
โ Document โ โโโโโโถ โ files_stream โ
โ UPLOADED โ โโโโโโโโฌโโโโโโโโ
โโโโโโโโโโโโ โ Dispatcher
โ (MIME detection)
โโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโ
โผ โผ โผ
โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ
โ pdf_stream โ โimage_streamโ ... โvideo_streamโ
โโโโโโโฌโโโโโโโ โโโโโโโฌโโโโโโโ โโโโโโโฌโโโโโโโ
โ โ โ
โผ โผ โผ
โโโโโโโโโโโโโ โโโโโโโโโโโโโ โโโโโโโโโโโโโ
โ QUEUED โ โ PARSING โ โ PARSED โ
โโโโโโโฌโโโโโโ โโโโโโโฌโโโโโโ โโโโโโโฌโโโโโโ
โ โ โ
โผ โผ โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
โ ParsedChunkSet + Chunks โโโโถ โ embed_stream โ
โ (Postgres) โ โโโโโโโฌโโโโโโโโโ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โผ
โโโโโโโโโโโโโ
โ EMBEDDING โ
โโโโโโโฌโโโโโโ
โ
โโโโโโโโโโโโดโโโโโโโโโโโโโ
โผ โผ
โโโโโโโโโโโโโ โโโโโโโโโโโโโ
โ Qdrant โ โ READY โ
โ vectors โ โ (or FAIL) โ
โโโโโโโโโโโโโ โโโโโโโโโโโโโ
Recovery: Each stream has its own consumer group. Workers run a stale-job reclaimer (
XAUTOCLAIM). AfterMAX_RETRIES, jobs move to a Dead Letter Queue (dlq_stream).
๐ Retrieval & Chat
โโโโโโโโโโโโโโโโโโโโ
โ User message โ
โโโโโโโโโโฌโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโ
โ Embed query โ
โ dense BGE + โ
โ sparse SPLADE โ
โโโโโโโโโโฌโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโ
โ Qdrant hybrid โ prefetch dense top-50
โ query โ prefetch sparse top-50
โ โ fuse with RRF โ top 50
โ โ (filtered by user's docs)
โโโโโโโโโโฌโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโ
โ Cross-encoder โ
โ rerank โ top 5 โ
โโโโโโโโโโฌโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโ
โ System prompt + โ
โ recent history + โ
โ project prompt โ
โโโโโโโโโโฌโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโ
โ OpenRouter SSE โ
โ stream โ
โโโโโโโโโโฌโโโโโโโโโโ
โผ
โโโโโโโโโโโโโโโโโโโโ
โ Answer + sources โ
โ stored on msg โ
โโโโโโโโโโโโโโโโโโโโ
๐ฌ Chat Features
| Feature | Details |
|---|---|
| ๐ Streaming replies | Real-time SSE streaming from OpenRouter |
| ๐ Source citations | Each answer carries ranked chunk references |
| ๐ Projects | Organize chats with custom system prompts |
| ๐ Pin / delete | Manage chat history |
| โ๏ธ Edit & resend | Create version branches (1/2, 2/2) |
| ๐ Web mode | /web prefix triggers LangGraph research agent |
| ๐ Live agent steps | Watch the web agent search, reason, and refine in real-time |
| ๐ Conversation summaries | Rolling summaries injected into later prompts |
๐ API Surface
Base path: /api/v1 (JWT middleware on all routes except /auth/*).
| Area | Methods | Description |
|---|---|---|
| ๐ Auth | POST /auth/signup, POST /auth/signin |
User registration & login |
| ๐ค Upload | POST /upload/post-file-url, POST /upload/confirm |
Presigned URL flow |
| ๐ Documents | GET /download/list, POST /download/get-download-url, DELETE /download/:id |
File management |
| ๐ฌ Chat | GET /chat, GET /chat/:id, PATCH /chat/:id, DELETE /chat/:id, POST /chat/message |
Chat CRUD + SSE streaming |
| ๐ Projects | GET/POST /projects, PATCH/DELETE /projects/:id |
Project management |
๐ฅ๏ธ Frontend Routes
| Route | Purpose |
|---|---|
/ |
Landing page (redirects to chat if signed in) |
/signin, /signup |
Authentication |
/dashboard |
Upload documents, view status, download / delete |
/chat |
Full chat UI with history, projects, sources, web agent |
๐๏ธ Data Model (Postgres)
| Model | Role |
|---|---|
User |
Username + hashed password |
Document |
Title, object key, mimeType, modality, status (UPLOADED โ READY / FAILED) |
ParsedChunkSet |
Group of parsed chunks per modality, status (PARSED / INDEXED) |
ParsedChunk |
Individual text chunk with JSON metadata (page, timestamp, caption, OCR, etc.) |
Project |
Named workspace + optional system prompt |
Chat |
Title, pin, optional project, summary fields |
Message |
role, content, sourceChunks JSON |
Memory |
Schema for durable facts (not wired into chat yet) |
Chunk vectors live in Qdrant with payload including
documentId,chunkId,modality,page,timestamps,caption.
๐พ Storage Roles
| Store | What it holds |
|---|---|
| ๐๏ธ MinIO | Original asset files (PDF, images, audio, video) |
| ๐ PostgreSQL | Users, docs, chunk sets, chunks, chats, messages, projects |
| ๐จ Redis Streams | Multi-stream job queue per modality + consumer group PEL + DLQ |
| ๐งญ Qdrant | Per-chunk dense + SPLADE vectors and text payload |
There is no OpenSearch โ lexical signal comes from SPLADE sparse vectors inside Qdrant, fused with dense cosine via RRF.
๐ญ Observability
@repo/langfuse instruments:
| Pipeline | Traced steps |
|---|---|
| ๐ฌ Chat RAG | hybrid-retrieve โ cross-encode-rerank โ generate-response |
| ๐ Web agent | LangGraph nodes (search โ reason โ refine โ answer) |
| ๐ Ingest | process-document and nested per-modality steps |
If Langfuse keys are missing, tracing no-ops silently.
Key design decisions:
- ๐ช Custom hook (
useChatState) encapsulates ~50 state variables and all SSE streaming logic - ๐งฉ Presentational components are pure โ they receive props and render
- ๐ฆ Types & helpers are shared across all modules via local imports
- ๐ Zero changes to the route import (
import ChatPage from "@/components/chat-app"resolves toindex.tsx)
๐ Local Development
๐ Prerequisites
- Bun โฅ 1.3
- PostgreSQL
- Redis
- MinIO
- Qdrant
- API keys: LlamaCloud, OpenRouter; optional HF, Exa, Langfuse
๐ Quick Start
# ๐ฆ Install dependencies
bun install
# โ๏ธ Configure environment (root and/or apps/*)
# Typical keys: DATABASE_URL, MinIO, JWT_SECRET, PORT,
# STREAM_NAME / GROUP_NAME, COLLECTION, DENSE_DIM,
# OPENROUTER_API_KEY, LLAMA_CLOUD_API_KEY, etc.
# ๐๏ธ Apply Prisma migrations
cd packages/db && bunx prisma migrate dev
# ๐ Start everything (web + backend + workers)
bun run dev
๐ฏ Run Individually
bun run --filter web dev # ๐ฅ๏ธ Next.js on :3001
bun run --filter backend dev # โ๏ธ Express on :3000
bun run --filter workers dev # ๐ญ All workers
bun run --filter workers dev:pdf # ๐ PDF worker only
bun run --filter workers dev:embedder # ๐งฎ Embedder only
bun run --filter workers dev:dlq # ๐ DLQ worker only
๐ง Development Commands
| Command | Purpose |
|---|---|
bun install |
Install dependencies |
bun run dev |
Start all apps via Turborepo |
bun run build |
Production build |
bun run lint |
ESLint (web: --max-warnings 0) |
bun run check-types |
TypeScript check |
bun run format |
Prettier (--write) |
cd packages/db && bunx prisma migrate dev |
Apply migrations |
๐งญ Design Principles
| Principle | Description |
|---|---|
| โก Async ingest | Uploads never block on parse/embed |
| ๐ Hybrid retrieval | Dense meaning + sparse terms, fused with RRF |
| ๐ Source grounded | Answers carry chunk citations |
| ๐ User scoped | Retrieval and deletes are filtered by ownership |
| ๐งฉ Modular monorepo | Shared clients in packages/* |
| ๐ญ Observable | Optional Langfuse traces end to end |
| ๐ Decoupled parsing & embedding | Re-embed without reparsing via ParsedChunkSet |
| โ Extensible modalities | New types need only a new parser worker |
๐ง RecallOS
Search your knowledge. Cite your sources.
