Technical Documentation v2.0

Knowledge Base AI

Complete technical documentation for the AI-powered knowledge management system. Built with Ruby on Rails and Next.js.

Ruby 3.4.8Rails 8.1.2Next.js 16.1.6React 19.2.3PostgreSQL 17pgvectorOllama LLM

Project Overview

Knowledge Base AI is a full-stack application enabling semantic search and AI-powered Q&A over your documents.

18+

API Endpoints

4

Database Tables

7

Services

768

Vector Dims

Core Features

Knowledge Base Management

Create, organize, and manage collections of documents with full CRUD operations.

Document Processing

Automatic chunking, embedding generation, and background indexing of documents.

Semantic Search

Vector similarity search using pgvector HNSW index for meaning-based queries.

RAG-Powered Q&A

Get AI-generated answers grounded in your documents using Retrieval-Augmented Generation.

Key Concepts Explained

Embeddings convert text into numerical vectors that capture semantic meaning. Similar concepts have vectors that are close together in 768-dimensional space.

"The cat sat on the mat"

nomic-embed-text

[0.23, -0.45, 0.89, ... 768 dims]

Cosine Similarity Comparison:

"A cat rested on a rug"
0.89
"Dogs are great pets"
0.54
"The stock market crashed"
0.12

All code snippets are extracted from actual source files. This documentation reflects the real implementation.

Sathwik SangeethamFebruary 2026