diff --git a/README.md b/README.md index 703779b..9c02a24 100644 --- a/README.md +++ b/README.md @@ -266,9 +266,9 @@ documind/ --- -## Screenshots +## Demo -> *Screenshots coming soon — upload a PDF, ask questions, see sources cited inline.* +https://github.com/user-attachments/assets/290e7caf-6676-43c2-9f9f-9df63d28c3f9 --- diff --git a/rag/agents/graph.py b/rag/agents/graph.py index 725c648..ab451dd 100644 --- a/rag/agents/graph.py +++ b/rag/agents/graph.py @@ -52,12 +52,13 @@ def retrieve(state: GraphState) -> GraphState: def direct_response(state: GraphState) -> GraphState: """Return a response for general conversation (no retrieval needed).""" - return { - "generation": ( - "Hello! I'm a PDF assistant. Please ask me a question about your " - "document and I'll look it up for you." - ) - } + question = state.get("question", "").strip().lower() + greetings = {"hi", "hello", "hey", "hiya", "howdy", "sup", "what's up", "whats up"} + if any(question == g or question.startswith(g + " ") for g in greetings): + reply = "Hey! Ask me anything about your document and I'll find the answer for you." + else: + reply = "I can only answer questions about the document you've uploaded. What would you like to know?" + return {"generation": reply} def fallback(state: GraphState) -> GraphState: diff --git a/requirements.txt b/requirements.txt index 2ac4715..2d67b69 100644 --- a/requirements.txt +++ b/requirements.txt @@ -36,5 +36,5 @@ streamlit watchdog # Evaluation -ragas +ragas==0.0.22 datasets diff --git a/ui/components/chat.py b/ui/components/chat.py index ce4943b..c52dbda 100644 --- a/ui/components/chat.py +++ b/ui/components/chat.py @@ -23,21 +23,83 @@ def render_chat() -> None: if not st.session_state.current_doc_id: # ── Welcome screen ──────────────────────────────────────────────────── st.markdown(""" -
- Upload a PDF from the sidebar to start a conversation with your document.
- This assistant uses hybrid search (semantic + keyword),
- cross-encoder reranking, and Gemini 2.5 Flash to give you
- precise, document-grounded answers.
+
+ Upload a PDF from the sidebar. Ask a question and DocuMind will find the relevant parts, + generate an answer based only on your document, and show you exactly where it came from.
+