A local AI-powered file management system that enables semantic search over your files โ find documents based on meaning, not just filenames.
Traditional file systems rely on exact filename matching or keyword search, which often fails when:
- File names donโt reflect content
- You forget exact keywords
- Documents contain rich semantic information
This project solves that by building a real-time ingestion + semantic retrieval pipeline.
๐ Search files like: โdocuments about reinforcement learningโ instead of remembering filenames.
- Watches a directory for new or modified files
- Uses fsnotify + polling fallback for reliability across environments (Docker, Windows)
-
Extracts text from:
- Images (OCR via EasyOCR)
- Documents (PDFs, text files)
-
Uses a Python microservice
-
Converts extracted text into vector embeddings using:
sentence-transformers (all-MiniLM-L6-v2)
-
CPU-optimized for local machines
-
Stores:
- File metadata
- Extracted text
- Vector embeddings
-
Uses SQLite (3NF schema design)
- Accepts natural language queries
- Converts query โ embedding
- Computes similarity (Cosine Similarity)
- Returns top-k most relevant files
โโโโโโโโโโโโโโโโ
โ File System โ
โโโโโโโโฌโโโโโโโโ
โ
(fsnotify + poller)
โ
โโโโโโโโโผโโโโโโโโโ
โ Watcher (Go) โ
โโโโโโโโโฌโโโโโโโโโ
โ
โโโโโโโโโผโโโโโโโโโ
โ Worker Pool โ
โ (Concurrency) โ
โโโโโโโโโฌโโโโโโโโโ
โ HTTP
โโโโโโโโโผโโโโโโโโโโโโโโโ
โ Extraction Service โ
โ (Python + AI Models) โ
โโโโโโโโโฌโโโโโโโโโโโโโโโ
โ
โโโโโโโโโผโโโโโโโโโ
โ SQLite Storage โ
โ (Metadata + Vectors)
โโโโโโโโโฌโโโโโโโโโ
โ
โโโโโโโโโผโโโโโโโโโ
โ Search API (Go)โ
โโโโโโโโโโโโโโโโโโ
- Uses
fsnotifyfor real-time events - Adds polling fallback to handle Docker/Windows filesystem inconsistencies
- Ensures no file changes are missed
- Implements a bounded worker pool in Go
- Handles multiple file events concurrently
- Prevents blocking of the watcher thread
Each file ingestion follows:
Begin Transaction
โ Upsert File
โ Insert Extraction
โ Insert Embedding
Commit
Ensures:
- Consistency
- No partial writes
- Safe concurrent processing
- Query โ embedding vector
- Stored embeddings โ loaded from DB
- Similarity computed using:
Cosine Similarity
- Top-K results returned based on ranking
| Service | Responsibility |
|---|---|
| Watcher (Go) | File monitoring + ingestion |
| Extractor (Python) | OCR + embeddings |
| API (Go) | Semantic search |
-
Go (Golang)
- Concurrency (goroutines, channels)
- Worker pool design
- HTTP server
- Python
- FastAPI
- Sentence-Transformers
- EasyOCR
-
SQLite
- Relational schema (3NF)
- Vector storage (BLOB)
-
Docker + Docker Compose
-
Volume mounts for:
watched/(input files)data/(database)models/(AI models)
- ๐ Semantic file search (meaning-based)
- โก Real-time ingestion pipeline
- ๐งต Concurrent processing with worker pool
- ๐ง AI-powered embeddings
- ๐พ Persistent local storage
- ๐ณ Fully containerized setup
- ๐ Robust file watching (polling fallback)
git clone <repo-url>
cd AIFileManagerdocker compose up --buildPlace files inside:
watched/
They will be automatically indexed.
curl -X POST http://localhost:8080/search \
-H "Content-Type: application/json" \
-d '{"query":"machine learning","top_k":3}'cmd/
โโโ watcher/
โโโ api/
internal/
โโโ watcher/
โโโ worker/
โโโ storage/
โโโ search/
โโโ client/
โโโ model/
โโโ debounce/
extraction-service/
โโโ app/
โโโ Dockerfile
data/
watched/
models/
docker-compose.yml
โ Solved using polling fallback
โ Add retry logic / health checks
โ Optimized using:
- CPU-only PyTorch
- Slim base images
- External model volume
- ANN indexing (FAISS / HNSW)
- UI for browsing/search
- File preview support
- Incremental re-indexing
- Distributed storage
- Streaming ingestion pipeline
- Building event-driven systems
- Handling cross-platform filesystem issues
- Designing concurrent pipelines in Go
- Integrating AI into backend systems
- Managing multi-service architectures
This project demonstrates how to build a production-style AI system combining:
- Backend engineering (Go)
- AI/ML (Python)
- Data systems (SQLite)
- Infrastructure (Docker)
๐ Result: A local semantic search engine for your files
Built as a hands-on project to explore:
- Backend system design
- AI integration
- Real-world data pipelines