A high-performance Retrieval-Augmented Generation system designed for rapid information extraction from diverse data sources.
src/
├── api/ # REST API layer
│ ├── middleware/ # Authentication, rate limiting, validation
│ └── routes/ # API route definitions
├── config/ # Configuration management
│ ├── defaults.ts # Default configuration values
│ ├── env.ts # Environment variable loading
│ ├── file.ts # File-based configuration
│ └── validation.ts # Configuration validation
├── data/ # Data access layer
│ ├── connectors/ # Data source connectors
│ └── repositories/ # Data repositories
├── models/ # TypeScript interfaces and types
│ ├── config.ts # System configuration models
│ ├── content.ts # Content and indexing models
│ ├── dataSource.ts # Data source models
│ ├── query.ts # Query and search models
│ └── response.ts # Response and result models
├── services/ # Business logic services
├── test/ # Test utilities and setup
└── utils/ # Utility functions
-
Install dependencies:
npm install
-
Copy environment configuration:
cp .env.example .env
-
Configure your environment variables in
.env -
Build the project:
npm run build
-
Start the development server:
npm run dev
The system supports configuration through:
- Environment variables (see
.env.example) - JSON configuration files
- Programmatic configuration
Key configuration areas:
- Server: Port, CORS, rate limiting
- Database: Vector database and metadata storage
- Cache: Redis configuration and TTL settings
- Embedding: Model provider and settings
- Search: Search parameters and hybrid search
- Monitoring: Logging, metrics, and health checks
npm run dev- Start development server with hot reloadnpm run build- Build for productionnpm run test- Run test suitenpm run lint- Run ESLintnpm run lint:fix- Fix ESLint issues
The system follows a modular architecture with clear separation of concerns:
- API Layer: Handles HTTP requests and responses
- Service Layer: Contains business logic and orchestration
- Data Layer: Manages data sources and storage
- Configuration: Centralized configuration management
- Models: TypeScript interfaces for type safety
- Node.js >= 18.0.0
- Redis (for caching)
- Vector database (FAISS, Pinecone, Weaviate, or Qdrant)
- Metadata database (PostgreSQL, MongoDB, or SQLite)