A full-stack RAG (Retrieval-Augmented Generation) system that combines semantic search with LLM tool integration. Built with Node.js, React, SQLite vector search, and FastMCP for seamless AI agent integration.
- Document Management: CRUD operations for knowledge documents with automatic vector embeddings
- Semantic Search: Natural language search with metadata filtering and similarity scoring
- Vector Storage: SQLite with sqlite-vss extension for efficient vector similarity search
- MCP Integration: FastMCP server exposing rag_search tool for Claude, OpenAI, and other LLM frameworks
- Web Interface: Modern React UI for document management and search testing
- Health Monitoring: Real-time system health dashboard
- Multi-Database Support: Repository pattern enables PostgreSQL migration
- Node.js 18+ (LTS recommended)
- npm 9+ or yarn 1.22+
- OpenAI API Key (for embeddings)
-
Clone the repository
git clone https://github.com/your-org/interactive-sqlite-rag-mcp.git cd interactive-sqlite-rag-mcp -
Install backend dependencies
cd backend npm install -
Install frontend dependencies
cd ../frontend npm install
-
Backend environment variables
cd backend cp .env.example .env # Edit .env with your OpenAI API key
-
Frontend environment variables (optional, defaults should work for development)
cd ../frontend cp .env.example .env
-
Start the backend server
cd backend npm run devServer will start on http://localhost:3000
-
Start the frontend (in another terminal)
cd frontend npm run devFrontend will start on http://localhost:5173
-
Access the application
- Web interface: http://localhost:5173
- API documentation: http://localhost:3000/api/docs (when implemented)
- MCP server: http://localhost:3001 (for LLM integration)
POST /api/documents- Create document with auto-embeddingsGET /api/documents- List documents (paginated)GET /api/documents/:id- Get document by IDPUT /api/documents/:id- Update documentDELETE /api/documents/:id- Delete document
POST /api/search- Semantic search with filters
GET /api/health- System health status
GET /mcp/tools- List available MCP tools
The system exposes a rag_search tool for LLM frameworks:
{
"name": "rag_search",
"description": "Search the knowledge base using semantic similarity",
"parameters": {
"query": "string (required)",
"filters": "object (optional)",
"limit": "number (optional, default 10)"
}
}Add to your claude_desktop_config.json:
{
"mcpServers": {
"rag-server": {
"command": "node",
"args": ["/path/to/interactive-sqlite-rag-mcp/backend/src/mcp/server.js"],
"env": {
"OPENAI_API_KEY": "your-api-key"
}
}
}
}# Backend tests
cd backend
npm test
npm run test:coverage
# Frontend tests
cd frontend
npm test# Backend
cd backend
npm run lint
npm run lint:fix
# Frontend
cd frontend
npm run lint
npm run lint:fix# Run migrations
cd backend
npm run migrate
# Seed with sample data
npm run seedbackend/
├── src/
│ ├── models/ # Sequelize models
│ ├── repositories/ # Database abstraction layer
│ │ ├── adapters/ # SQLite/PostgreSQL adapters
│ ├── services/ # Business logic
│ ├── api/ # Express routes & middleware
│ └── mcp/ # FastMCP server
├── tests/ # Test suites
└── migrations/ # Database migrations
frontend/
├── src/
│ ├── components/ # React components
│ ├── pages/ # Page components
│ ├── services/ # API clients
│ └── lib/ # Utilities
└── tests/ # Component tests
- Search Latency: <200ms p95 for queries against <1K documents
- Document Creation: <500ms including embedding generation
- Memory Usage: <512MB for typical workloads
- Concurrent Users: Supports 10+ simultaneous search requests
- Follow the project's Constitution
- Write tests before implementation (TDD)
- Ensure 80% test coverage minimum
- Pass all linting checks
- Update documentation for user-facing changes
MIT License - see LICENSE file for details.
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: See docs/ directory