Project Structure
Overview of the codebase organization.
rag/
├── convex/ # Convex backend
│ ├── agent.ts # AI agent configuration
│ ├── chat.ts # Chat-related functions
│ ├── files.ts # File management
│ ├── indexing.ts # Document indexing
│ ├── parsers.ts # File content parsers
│ ├── rag.ts # RAG utilities
│ ├── schema.ts # Database schema
│ ├── search.ts # Search functions
│ └── shared.ts # Shared utilities
│
├── src/ # React frontend
│ ├── components/ # UI components
│ │ ├── ai-elements/ # AI-related components
│ │ ├── chat/ # Chat interface
│ │ ├── table-files/ # File list table
│ │ └── ui/ # shadcn/ui components
│ ├── hooks/ # Custom React hooks
│ ├── lib/ # Utilities
│ ├── routes/ # TanStack Router pages
│ └── styles.css # Global styles
│
├── docs/ # VitePress documentation
├── example-docs/ # Sample documents
├── public/ # Static assets
└── .github/ # GitHub configuration
├── workflows/ # CI/CD workflows
└── ISSUE_TEMPLATE/ # Issue templatesKey Directories
/convex
Backend code that runs on Convex:
- schema.ts: Defines database tables and indexes
- agent.ts: AI agent setup and configuration
- chat.ts: Message handling and thread management
- parsers.ts: Extract text from different file formats
- indexing.ts: Chunk and embed documents
/src/components
React components organized by feature:
- ai-elements/: Reusable AI UI components (messages, loaders, etc.)
- chat/: Main chat interface components
- table-files/: Document list and management
- ui/: Base shadcn/ui components
/src/routes
TanStack Router file-based routes:
__root.tsx: Root layout with sidebarindex.tsx: Home/file upload pagechat.tsx: Chat layoutchat.$threadId.tsx: Individual chat thread
Configuration Files
| File | Purpose |
|---|---|
convex.config.ts | Convex project config |
vite.config.ts | Vite build config |
tsconfig.json | TypeScript config |
eslint.config.js | ESLint rules |
components.json | shadcn/ui config |
