import streamlit as st from PIL import Image from agentic_rag import AgenticRAG # Import the class from your OOP implementation import pandas as pd import plotly.express as px # Initialize the AgenticRAG instance agentic_rag = AgenticRAG() # Load images header_image = Image.open("header_image.webp") # Replace with a relevant image path sidebar_image = Image.open("sidebar_image.webp") # Replace with a relevant image path # Header with image #st.title("🌟 Agentic RAG: Q & A System") # Tabs with custom styling (visually appealing) tab1, tab2 = st.tabs(["📝 Ask ANA", "📊 View Analytics"]) st.markdown( """ """, unsafe_allow_html=True, ) # Tab 1: Ask ANA with tab1: st.image("header_image.webp", use_container_width=True) #st.markdown("## 📝 Ask ANA: Your Health Query Assistant") # Sidebar with instructions and image st.sidebar.image(sidebar_image, caption="ANA: Your Health Query Assistant", use_container_width=True) st.sidebar.header("Instructions") st.sidebar.write(""" 1. Enter your query in the input box below. 2. Click on the **Submit** button. """) st.sidebar.markdown( "### About\nANA is powered by Agentic RAG and LangGraph that combines LLM with document retrieval and web search to provide accurate answers based on context." ) # Main Q&A Section query = st.text_input("📝Type your question below:", "") if st.button("Submit"): if query.strip(): with st.spinner("Processing your query..."): # Invoke the AgenticRAG pipeline response = agentic_rag.invoke(query) # Display the results st.success("Query processed successfully!") st.markdown("### 💡 ANA Says") st.write(response.get("generation", "No response generated.")) else: st.warning("Please enter a valid question.") # Tab 2: View Analytics with Columns with tab2: #st.markdown("## 📊 Analytics Dashboard") col1, col2 = st.columns(2) with col1: # Query Insights Card #st.markdown("### Query Insights") st.markdown( """