About This Project

A production-ready, AI-powered knowledge management system built with Ruby on Rails and modern web technologies. This project demonstrates enterprise-grade software engineering practices across 12 development phases.

Ready to experience it?

Create an account to start using the Knowledge Base platform

609+

Test Cases

87%+

Code Coverage

0

Security Issues

0

Lint Violations

Architecture Overview
Frontend Layer

Next.js with TypeScript provides a modern, type-safe React application with server-side rendering capabilities and the App Router for optimal performance.

API Layer

Rails 8.1.2 API serves RESTful endpoints with JWT authentication, request validation, and comprehensive error handling.

AI Layer

Ollama provides local AI processing for embeddings and LLM responses, ensuring data privacy while enabling semantic search and RAG capabilities.

Development Phases

This project was built through 12 comprehensive development phases, each adding essential functionality while maintaining code quality and test coverage.

Phase 1

Project Setup & Core Models

Foundation setup with Rails 8.1.2, PostgreSQL 17, and pgvector extension for vector similarity search.

Ruby 3.4.8Rails 8.1.2PostgreSQL 17pgvectorRSpec
Rails API-only mode configuration
PostgreSQL with pgvector extension
Core models: User, KnowledgeBase, Document, Chunk
Database migrations with vector columns
Phase 2

JWT Authentication System

Secure authentication using JSON Web Tokens with bcrypt password hashing.

JWTbcryptSecureRandom
User registration with email validation
Secure password hashing with bcrypt
JWT token generation and validation
Token expiration handling
Phase 3

RESTful API Design

Complete CRUD operations with JSON:API conventions and proper HTTP status codes.

RESTJSON:APIBlueprinter
Knowledge Base CRUD endpoints
Document management API
Nested routing for documents
Blueprinter serializers
Phase 4

Document Processing Pipeline

Automated document chunking and processing for optimal search performance.

Text ProcessingChunking Algorithm
Intelligent text chunking
Configurable chunk size and overlap
Metadata preservation
Processing status tracking
Phase 5

Vector Embeddings with Ollama

Local AI-powered embeddings using nomic-embed-text model for semantic understanding.

Ollamanomic-embed-text768-dim vectors
Local embedding generation
768-dimensional vector representations
Semantic text understanding
Privacy-preserving AI processing
Phase 6

Background Job Processing

Asynchronous document processing using Solid Queue for seamless user experience.

Solid QueueActiveJobBackground Workers
Solid Queue integration
Async document indexing
Job status monitoring
Error handling and retries
Phase 7

Vector Similarity Search

High-performance semantic search using pgvector cosine similarity.

pgvectorCosine SimilarityVector Index
Semantic search endpoints
Cosine similarity ranking
Configurable result limits
Search performance optimization
Phase 8

RAG Question Answering

Retrieval-Augmented Generation using llama3.2:3b for accurate, sourced answers.

RAGllama3.2:3bLLM Integration
Context-aware Q&A system
Source citation tracking
Customizable chunk retrieval
Response quality optimization
Phase 9

Error Handling & API Standards

Comprehensive error handling with consistent JSON error responses.

Exception HandlingHTTP Status CodesError Serialization
Custom error classes
Consistent error format
Request ID tracking
Validation error handling
Phase 10

API Documentation

Interactive API documentation using Swagger/OpenAPI specification.

SwaggerOpenAPI 3.0Rswag
Auto-generated API docs
Interactive testing interface
Request/response examples
Schema documentation
Phase 11

Comprehensive Testing

Extensive test coverage with RSpec, including edge cases and performance tests.

RSpecFactoryBotSimpleCovrspec-benchmark
609+ passing tests
87%+ code coverage
Edge case validation
Performance benchmarking
Phase 12

Security & Performance Audit

Security scanning with Brakeman, code linting with RuboCop, and performance optimization.

BrakemanRuboCopPerformance Tuning
0 security vulnerabilities
0 code style violations
Query optimization
Production-ready codebase

Complete Technology Stack

A comprehensive overview of all technologies, frameworks, and libraries used in this project.

Backend Framework
Ruby3.4.8

Dynamic, object-oriented programming language

Ruby on Rails8.1.2

Full-stack web application framework

Rack3.x

Modular Ruby webserver interface

Database & Storage
PostgreSQL17

Advanced open-source relational database

pgvector0.8+

Vector similarity search extension

Solid Cache1.x

Database-backed Rails cache store

AI & Machine Learning
OllamaLatest

Local large language model runner

nomic-embed-text1.5

768-dim embedding model

llama3.2:3b3b

Language model for Q&A generation

Background Processing
Solid Queue1.x

Database-backed Active Job backend

ActiveJob8.x

Rails job framework

Authentication & Security
JWT2.x

JSON Web Token authentication

bcrypt3.x

Secure password hashing

BrakemanLatest

Security vulnerability scanner

Testing & Quality
RSpec3.x

BDD testing framework

FactoryBot6.x

Test data factories

SimpleCov0.22

Code coverage analysis

RuboCopLatest

Ruby code linter

Frontend Stack
Next.js16

React framework with App Router

TypeScript5.x

Typed JavaScript superset

Tailwind CSS4.x

Utility-first CSS framework

shadcn/uiLatest

Accessible component library

State & API
Zustand5.x

Lightweight state management

Axios1.x

HTTP client for API calls

React Hook Form7.x

Form validation library

Key Differentiators

Privacy-First Design

All AI processing happens locally via Ollama. Your data never leaves your infrastructure.

Semantic Understanding

768-dimensional vector embeddings enable meaning-based search, not just keyword matching.

Production Ready

Built with enterprise patterns: background jobs, error handling, comprehensive testing.

Modern Architecture

Clean separation of concerns with Rails API backend and Next.js frontend.

Thoroughly Tested

609+ tests covering unit, integration, and edge cases with 87%+ coverage.

Clean Codebase

Zero RuboCop violations and zero Brakeman security warnings.