You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Star0 (0)You must be signed in to star a repository
About
Enterprise Meeting Brain Intelligence System Secure RAG, Knowledge Graphs, Metadata Search, Architecting a secure internal knowledge system for meeting intelligence, decision tracking, and discrepancy analysis. • Enabling chronological metadata tracing of faults, decisions, and records through natural-language queries within the local network
ScribeLink: Local Document Query Engine & Citation Lineage
ScribeLink is a 100% offline document query engine and decision-trail workspace for air-gapped environments. It combines layout-aware OCR text extraction, form-aware chunking, hybrid keyword/semantic search (RRF with title-boost + length normalization), RAPTOR hierarchical summaries, LLM-powered question answering, an interactive knowledge graph, and a tamper-evident SHA-256 audit ledger.
Built for semiconductor fabrication environments where sensitive process documents must never leave the local network.
Multi-column layout, tables, reading order; first choice
PyMuPDF
100
Native PDF text layer; parallel page processing (ThreadPoolExecutor, up to 8 workers)
Tesseract
90
Scanned images, final fallback for garbled pages
The OCRManager.process_with_fallback() iterates engines in priority order. Per-page garbled text detection (is_text_garbled()) triggers intra-document fallback: a single garbled page in a LiteParse PDF is re-routed to PyMuPDF, then Tesseract, while clean pages stay with the faster engine.
Garbled Text Detection Heuristics
Empty text: <10 chars
Unicode replacement: \ufffd present
Short word length: <200 chars AND avg word length <2.0
Alpha ratio: <40% alphabetic chars in line
Allowed char ratio: <75% alphanumeric/whitespace/common symbols in line
Threshold: >20% of lines garbled → whole page garbled
Shadow Text Cleaning (clean_shadow_text())
Post-processing function that detects and compresses double-rendered characters (e.g. GRROOUUPP → GROUP). Applied when ≥75% of a word's characters are consecutively duplicated.
Tokenizer, context builder, graph with edge labels
vector_store.py
~100
SQLite vector storage + cosine similarity
embedder.py
~30
Ollama embedding client
llm_client.py
80
Ollama + Groq LLM proxy (120s timeout)
ollama_runner.py
~50
Self-healing Ollama process manager
rag.py
4
Prompt templates
summarizer.py
~120
RAPTOR hierarchical L1+L2 summaries
conflict.py
~100
Semiconductor parameter conflict detection
lineage.py
~80
Document relationship edge generation
audit_ledger.py
~80
SHA-256 chained tamper-evident ledger
config.py
13
Environment + model configuration
Troubleshooting
Problem
Likely Cause
Fix
Ollama connection refused
Ollama not running
ollama serve or let auto-start via ollama_runner.py
Server exits immediately
Port 8000 in use
Kill existing process or change port in main.py
Auto-reload causes constant restart
SCL_RELOAD=true in production
Set SCL_RELOAD=false (default)
OCR returns empty
Missing system libs (Linux)
sudo apt install libgl1 libglib2.0-0 libgomp1
Upload stays pending
File too large or format issue
Check background task logs; serial processing
Search returns "No relevant text"
No embeddings built yet
Wait for background processing; check status
Hindi translation is Hinglish
Small model (gemma3:1b)
Upgrade to gemma3:4b or qwen2.5:3b
DB locked errors
Concurrent writes
Serial upload; reduce batch size
Groq fallback not working
GROQ_API_KEY not set
Set env var or disable USE_GROQ_FALLBACK
Known Limitations
CPU-only by default — no GPU acceleration for OCR or embeddings
No tenant isolation — single-user workspace with basic auth
Scalability cap — RRF computes cosine similarity in Python for all chunks; not suitable for 100k+ documents
Decisions table — schema exists but auto-population is roadmap
Language support — translation is English → Hindi only
No HTTPS/TLS — intended for local network; use a reverse proxy (nginx/caddy) for production
Small LLM — gemma3:1b struggles with complex multi-document synthesis and clean Hindi output
Offline / Air-Gapped Deployment
On an internet-connected machine, download:
Repository zip
All Python wheels (pip download -r requirements.txt -d wheels/)
Ollama models: embeddinggemma and gemma3:1b
ONNX OCR weights (in models/ocr/)
Transfer via USB to the air-gapped machine
Install with offline scripts
Run python main.py
License
MIT
About
Enterprise Meeting Brain Intelligence System Secure RAG, Knowledge Graphs, Metadata Search, Architecting a secure internal knowledge system for meeting intelligence, decision tracking, and discrepancy analysis. • Enabling chronological metadata tracing of faults, decisions, and records through natural-language queries within the local network