Skip to content

prashanth-prakash/know-et-al

Repository files navigation

🧠 Know et al. — Local Knowledge Base Chatbot

Motivation

Large language models are remarkable generalists — trained on massive corpora of internet-scale data. But they tend to hallucinate or "guess" when asked questions outside the bounds of their general training. This makes them unreliable for domain-specific tasks or queries tied to precise internal knowledge.

Know et al. is a lightweight, local-first chatbot that demonstrates:

How to restrict a language model to a specific knowledge base (Retrieval-Augmented Generation).

The ability to run on your own hardware without sending data to the cloud.

A foundation to plug in local language models, respecting privacy and control.

ARCHITECTURE OVERVIEW

Know et al/

├── main_gradio.py # Main UI + knowledge base loading

├── chonkit.py # Chunking logic

├── embedding.py # Sentence-transformer model loader

├── index_chunks.py # Indexing and embedding ingestion

├── query_me.py # Semantic search + Mistral formatting

├── sync_docs.py # Track updated PDFs

├── save_cache.py # Save/load cached embeddings

├── SearchPdfs.py # PDF text extraction

├── chroma_store/ # Directory for saved vector DBs (one per KB)

├── requirements.txt

├── Dockerfile

└── .gitignore

HOW IT WORKS

  1. Knowledge Base Setup

User can load an existing KB or create a new one.

On creation:

PDFs are loaded from a selected folder.

Text is chunked and embedded.

Embeddings are stored in a dedicated ChromaDB instance per KB.

Hashes of PDFs are tracked to avoid recomputation.

  1. Chat Interface

Powered by Gradio's ChatInterface

When a user asks a question:

Relevant chunks are retrieved using semantic similarity.

The question + results are passed to a generate_response_mistral() function.

Answer is streamed back to the user.

  1. RAG Loop Summary

User Query | Retrieve top-k matching chunks from Chroma | Compose prompt using query + docs | Local/OpenAI model generates answer

  1. Dockerized Deployment

To build and run the app in Docker:

docker build -t know-et-al . docker run -p 7860:7860 know-et-al

Ensure PDFs are accessible within the container if needed (e.g., via bind mounts).

  1. Current Features

Multiple KB support via dropdown

Per-KB local Chroma vector DBs

Automatic PDF sync and change detection

Embedding caching for performance

OpenAI-compatible chat formatting ("messages")

  1. Coming Soon

Chat history persistence

Tabbed UI per KB (like ChatGPT sidebar)

FastAPI interface for programmatic access

Integration with truly local models (e.g., Ollama, GGUF)

  1. Local-first, Privacy-respecting

This project is built around the principle that your knowledge should remain your own.

By enabling local vector search + retrieval and giving you control over what the model sees, Know et al. makes LLMs safer, more focused, and far less prone to hallucination.

No more guessing. Just answers from your docs.

👨‍💻 Author

Built by @prashanth-prakash — explore, fork, contribute!

About

RAG based semantic search engine for custom knowledge base

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published