-
Note that when running the project, it might take few seconds-up to a minute to scrape the articles and create a vector store
-
This project is a Retrieval-Augmented Generation (RAG)-based system designed to help pregnant women find tailored answers to their questions. By combining cutting-edge AI technology with curated resources, the system delivers accurate, personalized, and easy-to-understand information related to pregnancy.
The system tailors responses based on the user's pregnancy week, ensuring that the information provided is relevant to their specific stage.
Articles and resources are scraped from trusted sources, processed, and stored in a FAISS vector store for efficient retrieval.
Instead of lengthy explanations, the system condenses information into concise, user-friendly answers.
Provides summaries and URLs of the original sources used to answer questions, so users can verify the information.
The system fetches articles from specified URLs, which contain information about pregnancy topics.
The articles are split into smaller chunks using text splitting techniques.
These chunks are converted into vector embeddings using HuggingFace embeddings and stored in a FAISS vector store for efficient search.
When a user asks a question, the system uses a language model (OpenAI GPT) to understand the intent and context of the query.
The system retrieves the most relevant chunks of text from the FAISS vector store using similarity search.
The language model combines the retrieved chunks to generate a clear and concise response.
A summarization chain is also included to condense long or complex answers further.
The system adjusts its answers based on the pregnancy week selected by the user, providing stage-appropriate advice and insights.
-
LangChain: Framework for building retrieval-augmented applications.
-
HuggingFace Embeddings: Converts text into embeddings for similarity search.
-
FAISS: A fast similarity search tool used as the vector store.
-
OpenAI GPT: Generates responses and summaries from retrieved information.
-
Python: Core programming language for development.
-
Streamlit: Frontend for user interaction.
- Clone the Repository
git clone [<https://github.com/aruaycodes/PreggoAI.git>]
- Install Dependencies
pip install -r requirements.txt
- Add API Keys
Ensure you have access to OpenAI and other necessary API keys.
Create a .env file in the root directory and add your keys:
OPENAI_API_KEY=your_openai_key
Run the Application
streamlit run app.py
-
Select your pregnancy week from the dropdown.
-
Enter your question in the text box.
-
View the tailored response and summaries of source articles.
-
To get a new question answered, please press
Command+Enter, then type in your question
"What foods should I eat in my first trimester?"
"How can I manage back pain during pregnancy?"
"What are common symptoms at 20 weeks pregnant?"
-
Add more trusted pregnancy resources.
-
Enable multilingual support for more inclusivity.
-
Incorporate visual guides for key pregnancy topics.
-
Expand personalization to include specific health conditions or preferences.
- We welcome contributions! Please open an issue or submit a pull request with your suggestions and improvements.