Spaces:
Sleeping
Sleeping
Create README.md
Browse files
README.md
CHANGED
@@ -1,13 +1,52 @@
|
|
1 |
---
|
2 |
-
title: Info Assistant
|
3 |
-
emoji: 😻
|
4 |
-
colorFrom: gray
|
5 |
-
colorTo: purple
|
6 |
-
sdk: streamlit
|
7 |
-
sdk_version: 1.38.0
|
8 |
-
app_file: app.py
|
9 |
-
pinned: false
|
10 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
|
11 |
---
|
12 |
|
13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
license: apache-2.0
|
3 |
+
title: Self-Reflective CRAG Application "Info Assistant"
|
4 |
+
sdk: streamlit
|
5 |
+
emoji: 🌍
|
6 |
+
colorFrom: blue
|
7 |
+
short_description: Self Reflective Multi Agent LangGraph CRAG Application
|
8 |
---
|
9 |
|
10 |
+
# Overview
|
11 |
+
This project demonstrates a self Reflective corrective Retrieval Augmented Generation (CRAG) application built using LangGraph. The application leverages a Gemma2 9B LLM to provide informative and relevant responses to user queries. It employs a multi-agent approach, incorporating various components for enhanced performance and user experience.
|
12 |
+
|
13 |
+
# Key Features
|
14 |
+
Vector Store: Uses Chroma Vector Store to efficiently store and retrieve context from scraped webpages related to data science and programming.
|
15 |
+
Prompt Guard: Ensures question safety by checking against predefined guidelines.
|
16 |
+
LLM Graders: Evaluates question relevance, answer grounding, and helpfulness to maintain high-quality responses.
|
17 |
+
Retrieval and Generation: Combines context retrieval from vector store and web search with LLM generation to provide comprehensive answers.
|
18 |
+
Iterative Refinement: Rewrites questions and regenerates answers as needed to ensure accuracy and relevance.
|
19 |
+
Customization: Offers flexibility in model selection, fine-tuning, and retrieval methods to tailor the application to specific requirements.
|
20 |
+
Local Deployment: Can be deployed locally for enhanced user data privacy.
|
21 |
+
## Technical Specifications
|
22 |
+
LLM: Gemma2 9B
|
23 |
+
Vector Store: Chroma
|
24 |
+
Embeddings: Alibaba-NLP/gte-base-en-v1.5
|
25 |
+
Workflow: LangGraph
|
26 |
+
Model API: ChatGroq
|
27 |
+
Web Search: Wikipedia and Google SERP
|
28 |
+
## Workflow
|
29 |
+
User Query: User inputs a question.
|
30 |
+
Prompt Guard: Checks if the question is safe and appropriate.
|
31 |
+
Context Retrieval: Searches the vector store for relevant documents.
|
32 |
+
Document Relevance: Evaluates document relevance using LLM graders.
|
33 |
+
Web Search: If necessary, conducts web searches on Wikipedia and Google SERP.
|
34 |
+
Answer Generation: Generates a response using the retrieved documents and LLM.
|
35 |
+
Answer Evaluation: Evaluates answer grounding and helpfulness using LLM graders.
|
36 |
+
Refinement: If necessary, rewrites the question or regenerates the answer.
|
37 |
+
## Customization Options
|
38 |
+
Model Selection: Choose different LLM models based on specific needs (e.g., larger models for more complex tasks).
|
39 |
+
Fine-Tuning: Fine-tune the LLM to match specific styles or domains.
|
40 |
+
Retrieval Methods: Explore alternative vector stores or retrieval techniques.
|
41 |
+
## Local Deployment
|
42 |
+
To deploy the application locally, follow these steps:
|
43 |
+
|
44 |
+
Set up environment: Install required dependencies (LangGraph, Chroma, LLM API, etc.).
|
45 |
+
Prepare data: Scrape webpages and create the vector store.
|
46 |
+
Configure workflow: Define the workflow and LLM graders.
|
47 |
+
Run application: Execute the application to start processing user queries.
|
48 |
+
## Future Enhancements
|
49 |
+
Knowledge Base Expansion: Continuously update the vector store with new data.
|
50 |
+
Retrieval Optimization: Explore more efficient retrieval techniques.
|
51 |
+
Multi-lingual Support: Enable the application to handle multiple languages.
|
52 |
+
Integration with Other Applications: Integrate with other tools or platforms for broader use cases.
|