3 min read
Nous

Nous is an open-source personal knowledge assistant that allows you to interact with your personal documents and text files using natural language. It’s designed with a focus on privacy, security, and local processing.

DEMO

Note: For the demo, I personalized Nous using the Lord of the Rings Trilogy PDF.

🌟 Key Features

  • Talk to Your Documents: Interact with your personal knowledge base through natural language queries.
  • Local Processing: Uses local LLMs for enhanced privacy and security.
  • Self-Corrective RAG: Implements a Corrective RAG (CRAG) system for accurate information retrieval and response generation.
  • Web Search Integration: Falls back to web search when local knowledge is insufficient.
  • Document Ingestion: Supports various document sources including Google Docs, Google Drive, Dropbox, and GitHub gists.

🏗️ Architecture

Nous consists of two main services:

Nous architecture

  1. LLM Service (Flask App):

    • Manages communication with local LLMs via Ollama
    • Implements the Corrective RAG (CRAG) system
    • Uses LangGraph and Langchain for agentic workflow
    • Utilizes FAISS as the vector database
    • Employs Phi3-mini and TinyLlama as local LLMs
  2. HTTP Web Server (Golang with Gin):

    • Renders the UI using HTMX
    • Stores chat sessions and messages in SQLite
    • Utilizes Redis for query caching
    • Implements Levenshtein distance for efficient string matching on recent queries

🧠 CRAG Workflow

CRAG workflow

🛠️ Tech Stack

  • Local LLMs: Phi3-mini, TinyLlama
  • Vector Database: FAISS
  • Embedding Model: Nomic
  • Web Search: Tavily
  • Web Server: Golang with Gin
  • Frontend Rendering: HTMX (with Go Templ)
  • Cache: Redis
  • Database: SQLite
  • Workflow: LangGraph, Langchain
  • Communication with LLMs: Ollama

💡 Why Nous?

Nous was created to provide a seamless and secure way to interact with personal notes and documents. It prioritizes local processing and privacy while offering powerful knowledge retrieval and interaction capabilities.