Back to directory

AIDocumentLibraryChat

A demonstration project that uses Spring AI with Ollama or OpenAI to chat with documents stored in a library, embedding them into a PostgreSQL vector database to answer questions from their content.

AIDocumentLibraryChat

AIDocumentLibraryChat is a sample project showing how to use Spring AI to chat with documents uploaded to a library. Uploaded documents are stored in both a normal and a vector-enabled PostgreSQL database, and an AI model creates embeddings from document chunks that are stored alongside them.

When a user asks a question, it is turned into an embedding and used to query the vector database; the document with the lowest distance is loaded and used to ask the AI model for an answer grounded in that document's content, with a link back to the source document to limit hallucination and support further research. The backend uses Spring Boot, Spring AI, PostgreSQL with its vector, hstore and uuid-ossp extensions, and Liquibase for migrations, and can call OpenAI or locally run Ollama models such as LLava for image description or sqlcoder for SQL generation. The frontend is built with Angular, Angular Material and TypeScript, and the project also includes an MCP client and server so an assistant can request book and movie information through Spring AI's MCP support.

It is licensed under Apache-2.0.

More in RAG

See all 540
  • ai·rete·rag

    ai-rete-rag.com

    A platform that pairs a Rete rule engine with retrieval-augmented generation, so deterministic rules decide an outcome and grounded retrieval explains the decision in plain language.

  • Xtriever

    github.com

    A hybrid retrieval engine for retrieval-augmented generation, written in Rust to run on-device on a phone or a laptop, combining lexical BM25 search, dense embedding search, reciprocal-rank fusion and cross-encoder re-ranking with no server.

  • FileFlux

    github.com

    A .NET library that turns PDF, DOCX, HWP and other documents into optimized chunks for RAG systems, through a five-stage pipeline built on high-performance Rust FFI readers.