A simple command-line tool for crawling directories, converting documents to markdown, and performing semantic search using hybrid dense/sparse embeddings with AI-powered responses.
- PDF (
.pdf) - Microsoft Excel (
.xlsx) - Microsoft Word (
.doc,.docx) - Microsoft PowerPoint (
.ppt,.pptx)
src/
├── main.rs # Main application logic and CLI interface
├── cli_ui.rs # Terminal UI components and styling
├── ai.rs # OpenAI-compatible API client
└── qdrant_client.rs # Qdrant vector database operations
- Docker
- Rust 1.70+
- OpenAI API key (or compatible API like Google Gemini)
- Install required system packages on Ubuntu/Debian:
sudo apt update
sudo apt install -y libssl-dev pkg-config- Clone the repository:
git clone <repository-url>
cd semantic-search-cli- Install dependencies:
cargo build --release- Set up environment variables:
cp env.example .env
# Edit .env with your API keys and configurationAI config
- OpenAI: Use
https://api.openai.com/v1/chat/completionswithgpt-3.5-turboorgpt-4 - Google Gemini: Use
https://generativelanguage.googleapis.com/v1beta/openai/chat/completionswithgemini-2.5-flash - Other OpenAI-compatible APIs: Configure URL and model as needed
- Start the Qdrant container
docker run -p 6333:6333 -p 6334:6334 qdrant/qdrant- Run!
# Process all supported files in a directory:
cargo run -- --directory data
# Perform semantic search across processed documents:
cargo run -- --search "What are the safety requirements for tower installation?"
# Only process files modified since a specific timestamp:
cargo run -- --directory data --since 1640995200 # Unix timestamp--directory, -d: Directory to crawl (default:data)--since, -s: Only process files modified since this Unix timestamp--embed: Convert files to markdown and print content--search: Perform semantic search with the given query
- Dense: BGESmallENV15 (384 dimensions)
- Sparse: SPLADEPPV1
- Reranker: JINARerankerV1TurboEn
- Generate dense and sparse embeddings for the query
- Perform vector similarity search in Qdrant
- Combine results using Reciprocal Rank Fusion (RRF)
- Rerank top results using the reranker model
- Generate AI response based on retrieved context
# Tag release
git tag -a 0.2.0 -m "Message"
# Push tag and CI does the rest
git push --tags