Knosi

unlisted

by Knosi

Sync your vault to Knosi for AI-powered document search and chat.

ā˜… 1 starsUpdated 9mo agoMIT
View on GitHub

Knosi

Your personal knowledge base, powered by AI.

Knosi is a self-hosted platform for indexing and chatting with your documents. Upload PDFs, Markdown, and other files to get AI-powered answers grounded in your content.

🌐 knosi.ai


Why Knosi?

Existing knowledge base solutions fall short:

  • Claude Projects - No API for automation, manual uploads only, 10MB file size limit
  • Khoj - 10MB file size limit, complex auth requirements
  • Commercial solutions - Your data on their servers, expensive, vendor lock-in

Knosi was built to solve these problems:

  • āœ… No file size limits - Index large theological PDFs, technical manuals, research papers
  • āœ… Full automation - API-first design with Obsidian plugin and filesystem watcher
  • āœ… Complete control - Self-hosted, your data never leaves your infrastructure
  • āœ… Simple & reliable - ~500 lines of Python, Docker deployment, PostgreSQL + pgvector
  • āœ… Claude-powered - Native PDF parsing handles locked/protected PDFs that other tools can't read

Built by Joshua for indexing large theological documents for ministry work.


Quick Overview

ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”      ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│          LOCAL MACHINE              │      │              REMOTE SERVER (Docker)          │
│                                     │      │                                              │
│  ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”  │      │  ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā” │
│  │  Obsidian Plugin              │  │      │  │         React Frontend (:48080)        │ │
│  │  - or -                       │  │      │  ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜ │
│  │  Filesystem Watcher           │  │      │                      │                      │
│  ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜  │      │                      ā–¼                      │
│                  │                  │ HTTP │  ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā” │
│                  └──────────────────┼─────►│  │      FastAPI Backend (:48550)          │ │
│                                     │      │  ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”¬ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜ │
│  ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”  │      │           ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”“ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”           │
│  │        Your Vault             │  │      │           ā–¼                     ā–¼           │
│  │        (Documents)            │  │      │  ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”   ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”  │
│  ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜  │      │  │   PostgreSQL    │   │   Claude API    │  │
│                                     │      │  │   + pgvector    │   │                 │  │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜      │  ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜   ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜  │
                                             ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜

Features

  • šŸ”’ Complete Privacy - Self-hosted, your data never leaves your control
  • šŸ“„ No File Limits - Upload PDFs of any size (default 100MB, configurable)
  • ⚔ Powered by Claude - State-of-the-art PDF parsing and RAG chat
  • šŸ” Semantic Search - Advanced vector search with pgvector
  • šŸ”„ Auto-Sync - Obsidian plugin and filesystem watcher for automatic uploads
  • āš™ļø Fully Configurable - Customize embedding models, chunk sizes, and more

Documentation

šŸ“š Deployment Guides:

šŸ“– Additional Documentation:


Quick Start

1. Deploy the Server

Follow the Server Deployment Guide to:

  • Set up Docker on your VPS
  • Configure environment variables
  • Start the Knosi services

Services will be available at:

  • Web UI: http://your-server:48080
  • API: http://your-server:48550

2. Choose a Client

Pick one based on your workflow:

ClientBest ForGuide
Obsidian PluginObsidian-only workflowsObsidian Deployment Guide
Filesystem WatcherAny editor, catches all filesystem changesWatcher Deployment Guide

3. Start Syncing

  • Obsidian: Enable plugin, configure server URL, files sync automatically
  • Watcher: Run python knosi-sync.py --server ... --vault ...

4. Chat with Your Documents

Visit http://your-server:48080 and start asking questions!


Supported File Types

  • šŸ“• PDF (parsed via Claude API - handles locked PDFs)
  • šŸ“ Markdown (.md)
  • šŸ“„ Plain text (.txt)
  • 🌐 HTML (.html, .htm)
  • šŸ“‹ Org-mode (.org)
  • šŸ“œ reStructuredText (.rst)
  • šŸ“˜ Word documents (.docx)

Architecture

ServicePortDescription
Web48080React frontend - chat UI, document management
API48550FastAPI backend - indexing, search, chat
DB5432 (internal)PostgreSQL + pgvector for embeddings

Client Comparison

ClientAuto-startCatchesSync Strategy
Obsidian PluginBuilt-inObsidian edits onlyQueue-based (batched)
Filesystem WatchermacOS/Windows scriptsAll filesystem changesImmediate (debounced)

Recommendation:

  • Use Obsidian Plugin for Obsidian-only workflows (simpler setup)
  • Use Filesystem Watcher for multi-editor workflows or external file changes

Configuration

Server Environment Variables

VariableRequiredDefaultDescription
ANTHROPIC_API_KEYYes-Claude API key for PDF parsing and chat
POSTGRES_PASSWORDYes-PostgreSQL database password
API_SECRET_KEYNochange-me-in-productionClient authentication key
MAX_FILE_SIZE_MBNo100Maximum upload size in MB
EMBEDDING_MODELNoall-MiniLM-L6-v2Sentence-transformers model
EMBEDDING_DIMNo384Embedding dimension (must match model)

See Server Deployment Guide for full configuration details.

Embedding Models

ModelDimensionsAccuracySpeedBest For
all-MiniLM-L6-v2 (default)38478.1%FastGeneral use, limited resources
BAAI/bge-base-en-v1.576884.7%MediumHigh-quality English retrieval
intfloat/e5-base-v276883.5%MediumBalanced performance
all-mpnet-base-v2768HigherSlowerBest quality
nomic-ai/nomic-embed-text-v176886.2%SlowerMultilingual, large-scale

āš ļø IMPORTANT: Changing embedding models requires clearing the database and re-indexing documents. See Server Deployment Guide for details.

Recommended model for theological/scholarly documents: BAAI/bge-base-en-v1.5 (768 dims)


API Endpoints

Base URL: http://your-server:48550

EndpointMethodDescription
/api/statusGETServer status and document count
/api/documentsGETList indexed documents
/api/uploadPOSTUpload and index a file
/api/documents/{filename}DELETERemove document from index
/api/chatPOSTChat with documents (RAG)
/api/search?q=...GETSemantic search

Backups

PostgreSQL data is stored in a Docker volume or block storage. To backup:

# Backup database
docker exec knosi-db pg_dump -U knosi knosi > backup-$(date +%Y%m%d).sql

# Restore database
cat backup.sql | docker exec -i knosi-db psql -U knosi knosi

For block storage backups, see Server Deployment Guide.


Development

Running Locally

cd server

# Start database only
docker compose up -d db

# Run API locally (with hot reload)
cd api
pip install -r requirements.txt
DATABASE_URL=postgresql+asyncpg://knosi:password@localhost:5432/knosi \
ANTHROPIC_API_KEY=sk-ant-xxx \
uvicorn main:app --reload --port 48550

# Run web locally (with hot reload)
cd ../web
npm install
npm run dev  # Runs on http://localhost:3000

Building Obsidian Plugin

cd client/obsidian
npm install
npm run build  # Output: main.js

Troubleshooting

Server Issues

"Cannot connect to server"

# Check if API is accessible
curl http://your-server:48550/api/status

# Check logs
cd ~/knosi/server
docker compose logs -f api

"Auth failed: Check API key"

  • Ensure client's API key matches server's API_SECRET_KEY in .env

Client Issues

Obsidian Plugin:

Filesystem Watcher:


Security Checklist

  • āœ… Changed default POSTGRES_PASSWORD
  • āœ… Changed default API_SECRET_KEY
  • āœ… Firewall configured (ports 48080, 48550)
  • āœ… HTTPS enabled (if public-facing)
  • āœ… Regular backups configured
  • āœ… Keep system updated: sudo apt update && sudo apt upgrade

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Submit a pull request

License

MIT License - See LICENSE file for details.


Links


Built with ā¤ļø by Knosi

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.