william-ai-dev/xai-document-research
0
XAI Document Research Assistant
A sophisticated RAG (Retrieval-Augmented Generation) application for document analysis with advanced evaluation metrics and LangSmith tracing.
Features
- ๐ Multi-format Support: PDF, TXT, MD, DOCX document processing
- ๐ Advanced Retrieval: Hybrid search with semantic and BM25 ranking
- ๐ง AI-Powered Analysis: Groq Llama 3.1 integration for intelligent responses
- ๐ Quality Metrics: Faithfulness and answer relevancy evaluation using Ragas
- ๐ LangSmith Tracing: Full observability and debugging capabilities
- ๐ฌ Interactive Chat: Streamlit-based conversational interface
- โก Real-time Processing: Efficient embedding and retrieval pipeline
Technical Stack
- Frontend: Streamlit
- LLM: Groq Llama 3.1
- Vector Database: ChromaDB
- Embeddings: Sentence Transformers
- Evaluation: Ragas framework
- Tracing: LangSmith
- Document Processing: PyMuPDF4LLM, MarkItDown
Usage
- Upload a document (PDF, TXT, MD, or DOCX)
- Click "Process Document" to analyze and embed the content
- Ask questions about the document
- View detailed analysis including reasoning, sources, and quality metrics
Environment Variables
For Hugging Face Spaces, set these in the Secrets section:
LANGCHAIN_API_KEY: Required for LangSmith tracingGROQ_API_KEY: Required for Groq LLM accessLANGCHAIN_PROJECT: Project name for LangSmith (optional, defaults to "default")
Installation
pip install -r requirements.txt
streamlit run app.pyLicense
MIT License
