Cedar is a clinical support application that augments medical practitioners with AI-powered document analysis, second opinions on lab reports, imaging studies, and healthcare documents. Built with Electron, React, and Python, Cedar provides intelligent document processing, semantic search, and contextual AI assistance for healthcare professionals.
| Feature | Description |
|---|---|
| π Multi-Format Documents | PDF, DOCX, XLSX, PPTX, images, and more |
| πΌοΈ Medical Image Analysis | Multi-angle analysis using MedGemma |
| π Semantic Search | Vector-based similarity search across documents |
| π¬ AI-Powered Chat | Contextual conversations with RAG pipeline |
| π€ Voice Input | OpenAI gpt-4o-transcribe for hands-free operation |
| π Attachments | Upload supplementary files during chat |
| π Summarization | AI-generated document summaries |
| π Notes | Professional notes linked to documents |
- React 18 + TypeScript
- Tailwind CSS + shadcn/ui
- Zustand for state management
- Vite build tool
- Electron desktop runtime
- SQLite with better-sqlite3
- hnswlib-node for vector similarity search
- gpt-4o-transcribe for speech-to-text
- FastAPI with Granian ASGI server
- MarkItDown for document extraction
- OpenAI SDK for embeddings and transcription
- Google Vertex AI β MedGemma-1-27B IT for chat completions and image analysis
- OpenAI API β text-embedding-3-small for semantic embeddings, gpt-4o-transcribe for speech-to-text
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CEDAR APPLICATION β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β ββββββββββββββββββββ ββββββββββββββββββββββββββββββββββββ β
β β ELECTRON UI β β PYTHON API β β
β β (Renderer) β β (FastAPI + Granian) β β
β β β β β β
β β React + βββββΊβ - Chat Completions β β
β β TypeScript β β - Image Analysis (MedGemma) β β
β β Tailwind CSS β β - Document Extraction β β
β β Zustand Store β β - Embeddings (OpenAI) β β
β β Lucide Icons β β - Speech Transcription β β
β ββββββββββββββββββββ β - Summarization β β
β β ββββββββββββββββββββββββββββββββββββ β
β β β β
β βΌ βΌ β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β MAIN PROCESS (Electron) β β
β β β β
β β - IPC Bridge (preload.js) β β
β β - File System Access β β
β β - SQLite Database (metadata, FTS5) β β
β β - HNSW Vector Store (embeddings) β β
β β - Processing Queue β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β β
β βΌ β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β CLOUD SERVICES β β
β β β β
β β Google Vertex AI (MedGemma-1-27B IT) β β
β β βββ Chat completions with streaming β β
β β βββ Multi-angle image analysis β β
β β β β
β β OpenAI API (text-embedding-3-small, gpt-4o-transcribe) β β
β β βββ 768-dimension semantic embeddings, speech-to-text β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
- Node.js 20+ and npm or pnpm
- Python 3.12+
- Google Cloud credentials for Vertex AI access
- OpenAI API key for embeddings and transcription
# Clone the repository
git clone https://github.com/nwaughachukwuma/cedar.git
cd cedar
# Install dependencies
pnpm install
# Install Python dependencies
cd api && uv pip install -e . && cd ..
# Configure environment variables
cp .env.example .env
# Edit .env with your API keys
# Start development servers
npm run dev# Build the application
npm run build
npm run packagecedar/
βββ api/ # Python FastAPI backend
β βββ src/
β β βββ main.py # FastAPI application entry
β β βββ _env.py # Environment configuration
β β βββ constants.py # API constants and endpoints
β β βββ logger.py # Logging utilities
β β βββ chat_agent/ # Chat completions
β β β βββ base.py
β β β βββ no_streaming.py
β β β βββ use_openai.py
β β β βββ with_streaming.py
β β βββ embeddings/ # Text embeddings
β β β βββ base.py
β β β βββ nvidia_nim.py
β β β βββ utils.py
β β βββ image_agent/ # Medical image analysis
β β β βββ base.py
β β β βββ image_analysis.py
β β β βββ use_openai.py
β β β βββ utils.py
β β β βββ nvidia_nim/
β β βββ speech_transcription/ # Speech-to-text
β β β βββ base.py
β β β βββ nvidia_nim.py
β β β βββ use_openai.py
β β βββ summarization/ # Text summarization
β β β βββ base.py
β β β βββ use_openai.py
β β β βββ utils.py
β β βββ utils/ # Shared utilities
β β βββ medgemma_response.py
β β βββ nim_sdk.py
β β βββ openai_sdk.py
β β βββ parse_document.py
β β βββ vertext_auth.py
β βββ pyproject.toml
β βββ install.sh
β
βββ electron/ # Electron main process
β βββ main.ts # Application entry point
β βββ preload.ts # IPC context bridge
β βββ defineEnv.ts # Environment type definitions
β βββ ipc/
β β βββ index.ts # IPC handler registration
β β βββ chatHandlers.ts # Chat streaming handlers
β β βββ fileHandlers.ts # File upload/management
β β βββ noteHandlers.ts # Notes CRUD
β β βββ searchHandlers.ts # Search handlers
β β βββ debugHandler.ts # Debug utilities
β β βββ helpers/ # IPC helper modules
β βββ services/
β β βββ database.ts # SQLite database operations
β β βββ vectorStore.ts # HNSW vector storage
β β βββ modelService.ts # Model orchestration
β β βββ searchService.ts # Search coordination
β β βββ speechToText.ts # OpenAI gpt-4o-transcribe
β β βββ documentProcessor.ts # Document processing
β β βββ imageProcessor.ts # Image processing
β βββ workers/
β β βββ workerManager.ts # Background worker management
β β βββ worker.js # Worker script
β βββ utils/
β βββ fileProcessingQueue.ts # Async processing queue
β βββ runMigrations.ts # Database migrations
β βββ ...
β
βββ src/ # React frontend
β βββ App.tsx # Main application component
β βββ main.tsx # React entry point
β βββ components/ # React components
β β βββ FileList.tsx # Document browser
β β βββ FileDetailView.tsx # Document viewer + chat
β β βββ FilePreview.tsx # Document viewer
β β βββ ChatPanel.tsx # Chat interface
β β βββ ChatInput.tsx # Message input component
β β βββ SearchBar.tsx # Semantic search bar
β β βββ ...
β βββ stores/ # Zustand state stores
β β βββ fileStore.ts
β β βββ filesStore.ts
β β βββ chatStore.ts
β β βββ messageStore.ts
β β βββ ...
β βββ lib/ # Utilities and hooks
β βββ types/ # TypeScript type definitions
β
βββ migrations/ # SQLite migrations
βββ tests/ # Test suite
βββ docs/ # Documentation
βββ dist-electron/ # Built Electron application
βββ package.json
βββ README.md
# API Configuration
OPENAI_API_KEY=sk-...
GRANIAN_WORKERS=4
APP_ENV=dev
# Google Cloud (Vertex AI)
# Ensure gcloud CLI is authenticated| Table | Description |
|---|---|
files |
Uploaded documents and images |
chunks |
Document content segments for RAG |
embeddings |
Vector embedding metadata |
annotations |
Image analysis results |
chat_sessions |
Chat conversation sessions |
chat_messages |
Individual chat messages |
notes |
Professional notes |
processing_queue |
Async job tracking |
See migrations/ for complete schema.
| Endpoint | Method | Description |
|---|---|---|
/health-check |
GET | Health check |
/analyze-image |
POST | MedGemma image analysis |
/extract |
POST | Document content extraction |
/chat |
POST | Chat completions |
/get-embeddings |
POST | Generate text embeddings |
/get-transcription |
POST | Speech-to-text transcription |
/summarize-text |
POST | Text summarization |
# Run development server
pnpm dev
# Run tests
pnpm test
# Lint and format
pnpm lint
pnpm format
# Type check
pnpm typecheck- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License β see the LICENSE file for details.
Cedar is a clinical decision support tool. It is not intended to replace professional medical judgment or diagnosis. Always verify AI-generated insights with qualified healthcare providers.
Cedar β Empowering healthcare professionals with AI