Guidely is an internal support assistant designed to help team members quickly find accurate, plain-language answers from company documents without digging through pages of text. Powered by Retrieval-Augmented Generation (RAG), Guidely combines semantic search with real-time text generation while always providing clear citations for its sources.
- Frontend: React (Vite), Tailwind CSS, Lucide Icons
- Backend: FastAPI (Python), Uvicorn
- Embeddings: Local
sentence-transformers(all-MiniLM-L6-v2) - LLM: Groq API (
qwen/qwen3.8-27b) - Vector Store: FAISS
- Environment Management:
python-dotenv
-
Document Ingestion & Chunking: Ingests plain text and markdown documents from
/data/sample-docs/, splitting them into small context chunks (~500–1,000 tokens) with overlap. - Hashing & Caching: Computes SHA256 hashes of files to prevent re-embedding unchanged documents.
-
Vector Embeddings & Indexing: Converts text chunks into vector embeddings via local
sentence-transformersand stores them in a local FAISS index. -
Retrieval & RAG Generation: * Embeds the user query.
- Retrieves top-$k$ (
$k=3$ ) most similar text snippets. - Sends snippets and the user query to the LLM with instructions to cite sources.
- Retrieves top-$k$ (
- Response: Returns clean JSON containing the answer along with referenced filenames and snippets.
guidely/
├── frontend/
│ ├── public/
│ └── src/
│ ├── components/
│ ├── pages/
│ └── App.jsx
├── backend/
│ ├── main.py
│ ├── routes/
│ │ ├── documents.py
│ │ └── search.py
│ ├── models/
│ │ └── record.py
│ └── data/
│ └── sample-docs/
│ ├── policy.txt
│ ├── faq.txt
│ └── guide.txt
├── requirements.txt
├── .env.example
└── README.md
- Clone the repository:
git clone https://github.com/MargaretKerubo/guidely.git cd guidely - Backend Setup:
cd backend python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -r requirements.txt cp .env.example .env # Add your GROQ_API_KEY and OPENAI_API_KEY uvicorn main:app --reload --port 8000
- Frontend Setup:
cd frontend npm install npm run dev
Frontend will be running at: http://localhost:5173
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/search |
Submits user prompt; performs vector search & generates RAG answer with sources. |
POST |
/api/documents/upload |
Uploads raw documents (.txt, .md) to data directory. |
POST |
/api/documents/reindex |
Triggers document ingestion, chunking, and FAISS indexing. |
GET |
/health |
API health status. |
The system performance and quality targets are tracked below:
| Metric | Category | Target | Current Benchmark | Status |
|---|---|---|---|---|
| Retrieval@3 | Manual |
|
> 85% | ✅ Pass |
| Answer Reference Coverage | Manual |
|
> 95% | ✅ Pass |
| Source Precision | Manual |
|
> 85% | ✅ Pass |
| Latency (Median) | Auto-logged |
|
~ 0.5s | ✅ Pass |
| Latency (p95) | Auto-logged | < 2s | ✅ Pass | |
| Embedding Cache Effectiveness | Auto-logged |
|
100% | ✅ Pass |
| Failure Handling | Auto-logged | Graceful 4xx/5xx handling | Passes tests | ✅ Pass |
The API natively validates and gracefully handles common failure modes:
- Empty Query: Returns HTTP
400 Bad Request. - Missing API Key: Logs backend configuration failure and returns HTTP
500 Server Error. - Corrupted/Unreadable File: Skips corrupted files during ingestion and logs error.
- No Relevant Documents Found: Returns fallback response indicating lack of context rather than hallucinating.