Production-style AI knowledge assistant built with Retrieval-Augmented Generation (RAG) for enterprise document search and question answering.
- Frontend:
http://98.92.140.134 - API Docs:
http://98.92.140.134/docs
Note: Demo may be usage-limited to control API costs.
This project ingests PDF documents, extracts and chunks text, generates embeddings with OpenAI, stores vectors in FAISS, and answers questions using retrieved context through a FastAPI backend and a React frontend.
It is designed as a production-style AI application, not a toy demo, with a clean backend architecture, modular services, metadata persistence, vector retrieval, Dockerized deployment, and a polished frontend experience.
- PDF upload and ingestion pipeline
- Text extraction, cleaning, and chunking
- OpenAI embeddings
- FAISS vector search
- Retrieval-Augmented Generation (RAG)
- Source-aware answers with citations
- Query across all documents or a selected document
- SQLite metadata tracking with SQLAlchemy
- Duplicate document detection via content hashing
- Rebuildable vector index
- Document delete + reindex workflow
- FastAPI backend with modular architecture
- React + Vite + Tailwind frontend
- Dockerized frontend/backend deployment
- AWS EC2 deployment
- Structured logging and request tracing
- Python 3.11
- FastAPI
- SQLAlchemy
- SQLite
- FAISS
- OpenAI API
- PyPDF
- React
- Vite
- TypeScript
- Tailwind CSS
- Axios
- Docker
- Docker Compose
- AWS EC2
- GitHub Actions
Client (React + Vite + Tailwind)
│
▼
FastAPI Backend
├── Document Upload / Ingestion
│ ├── PDF parsing
│ ├── Text cleaning
│ ├── Chunking
│ ├── OpenAI embeddings
│ └── FAISS indexing
│
└── Query / RAG Service
├── Query embedding
├── Vector retrieval
├── Prompt assembly
└── OpenAI answer generation
Storage Layer
├── Raw PDF files
├── SQLite metadata DB
└── FAISS vector index
app/
api/
core/
db/
embeddings/
ingestion/
llm/
repositories/
retrieval/
schemas/
services/
storage/
utils/
frontend/
data/
scripts/
tests/
docs/
GET /api/v1/healthGET /api/v1/health/readyGET /api/v1/documentsGET /api/v1/documents/{document_id}POST /api/v1/documents/uploadDELETE /api/v1/documents/{document_id}POST /api/v1/documents/rebuild-indexPOST /api/v1/query
{
"question": "What is this document about?",
"top_k": 5,
"document_id": null
}{
"answer": "The document discusses ...",
"sources": [
{
"chunk_id": "chunk-id",
"document_id": "doc-id",
"filename": "sample.pdf",
"page_number": 1,
"chunk_index": 0,
"text_preview": "..."
}
]
}git clone https://github.com/oday198/enterprise-knowledge-assistant.git
cd enterprise-knowledge-assistantpython -m venv .venv
source .venv/bin/activatepip install -e ".[dev]"Copy .env.example to .env and set OPENAI_API_KEY
uvicorn app.main:app --reloadcd frontend
npm install
npm run devdocker compose up --build- Frontend:
http://localhost - API Docs:
http://localhost/docs
Recommended deployment: AWS EC2 with Docker Compose
High-level deployment flow:
- Launch Ubuntu EC2 instance
- Install Docker + Docker Compose
- Clone repository
- Create
.envfrom production template - Run
docker compose up --build -d - Expose port 80
pytest -qGitHub Actions CI is included for automated test runs on push/pull request.
- Modular monolith architecture for simplicity and production clarity
- FAISS abstraction layer to keep vector store replaceable
- Metadata DB + vector index separation
- Duplicate detection by content hash
- Document-scoped querying in addition to global querying
- Dockerized deployment for reproducibility
- Frontend + backend separation for cleaner architecture
- Background async ingestion
- Authentication / access control
- Rate limiting
- Managed vector DB option
- Cloud object storage for PDF files
- LLM response caching
- Better observability and metrics
- Reranking for retrieval quality
Oday Soueidan LinkedIn: https://www.linkedin.com/in/odaysoueidan GitHub: https://github.com/oday198



