ChienChung commited on
Commit
d2d97e1
Β·
verified Β·
1 Parent(s): 1fe4896

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +38 -22
app.py CHANGED
@@ -1801,26 +1801,51 @@ This demo presents a GPT-style Multi-Agent AI Assistant, built with **LangChain,
1801
  Feel free to upload a document and ask related questions, or just type a question directlyβ€”no file upload required. *Note: CSV file analysis and auto visualisation is coming soon.*
1802
  """
1803
  demo_description6 = """
1804
- This demo showcases a **LangGraph-powered multi-agent pipeline** designed for GPT-like smart document Q&A.
 
 
 
 
1805
 
1806
- 🧠 Workflow:
1807
- - Start with a **Document QA Agent**
1808
- - If summarisation is needed β†’ route to **Summariser Agent**
1809
- - If not found in doc β†’ fallback to **General Agent**
1810
- - If still no answer β†’ use **Search Agent**
 
 
1811
 
1812
- Agents are defined via CrewAI, but orchestrated using LangGraph for fine-grained control and agent collaboration.
 
 
 
 
 
 
 
 
1813
  """
1814
 
1815
 
1816
 
1817
  demo = gr.TabbedInterface(
1818
  interface_list=[
 
 
 
 
 
 
 
 
 
 
 
1819
  gr.Interface(
1820
  fn=multi_agent_chat_advanced,
1821
  inputs=[
1822
  gr.Textbox(label="Enter your query"),
1823
- gr.File(label="Upload file (CSV, PDF, TXT, DOCX)", file_count="single")
1824
  ],
1825
  outputs="text",
1826
  title="Multi-Agent AI Assistant",
@@ -1829,7 +1854,7 @@ demo = gr.TabbedInterface(
1829
  ),
1830
  gr.Interface(
1831
  fn=document_summarize,
1832
- inputs=[gr.File(label="Upload PDF, TXT, or DOCX")],
1833
  outputs="text",
1834
  title="Document Summarisation",
1835
  allow_flagging="never",
@@ -1837,7 +1862,7 @@ demo = gr.TabbedInterface(
1837
  ),
1838
  gr.Interface(
1839
  fn=upload_and_chat,
1840
- inputs=[gr.File(label="Upload PDF, TXT, or DOCX"), gr.Textbox(label="Ask a question")],
1841
  outputs="text",
1842
  title="Your Docs Q&A (Upload + GPT-4 RAG)",
1843
  allow_flagging="never",
@@ -1859,25 +1884,16 @@ demo = gr.TabbedInterface(
1859
  allow_flagging="never",
1860
  description=demo_description
1861
  ),
1862
- gr.Interface(
1863
- fn=langgraph_tab6_main,
1864
- inputs=[
1865
- gr.Textbox(label="Ask anything"),
1866
- gr.File(label="Upload one or more files", file_types=[".pdf", ".txt", ".docx"], file_count="multiple")
1867
- ],
1868
- outputs="text",
1869
- title="LangGraph GPT-like QA (Tab6)",
1870
- allow_flagging="never",
1871
- description=demo_description6
1872
- ),
1873
  ],
1874
  tab_names=[
 
1875
  "Multi-Agent AI Assistant",
1876
  "Document Summarisation",
1877
  "Your Docs Q&A (Upload + GPT-4 RAG)",
1878
  "Biden Q&A (GPT-4 RAG)",
1879
  "Biden Q&A (LLaMA RAG)",
1880
- "LangGraph Doc QA (Tab6)"
1881
  ],
1882
  title="Smart RAG + Multi-Agent Assistant (with Web + Document AI)"
1883
  )
 
1801
  Feel free to upload a document and ask related questions, or just type a question directlyβ€”no file upload required. *Note: CSV file analysis and auto visualisation is coming soon.*
1802
  """
1803
  demo_description6 = """
1804
+ **Context**:
1805
+ This is a **smart multi-document reasoning assistant**, powered by **LangGraph**, **CrewAI**, and **AutoGen**.
1806
+ Upload zero to multiple files and ask anything β€” the system will uses **embedding-based intent detection** to decide whether to summarise, extract, compare, or analyse relationships.
1807
+
1808
+ For complex multi-file tasks, it triggers a **collaborative AutoGen team** to deeply reason across documents and generate contextual, evidence-based answers.
1809
 
1810
+ **Supported Features**:
1811
+ - πŸ“„ Multi-document support (PDF, DOCX, TXT)
1812
+ - πŸ” Embedding-based intent detection and semantic routing
1813
+ - πŸ€– Agents: Summariser, QA Agent, General Agent, Search Agent
1814
+ - πŸ”€ Orchestrated by LangGraph + AutoGen (fallbacks + task handoff)
1815
+ - 🧠 AutoGen multi-agent collaboration for cross-file reasoning
1816
+ - 🌐 Online search fallback if all the other agent can't handle tasks
1817
 
1818
+ **Sample Questions**:
1819
+ 1. Who are you? | What is GPT4? *(β†’ General Chat Agent)*
1820
+ 2. Summarise the document/file/your_doc_name. *(β†’ Summarisation Agent)*
1821
+ 3. What is LangChain used for? | What are the latest trends in AI startups in 2025? | Tell me the most recent breakthrough in quantum computing. *(β†’ Online Rag Agent)*
1822
+ 4. What's the title in the document? | What are the key ideas mentioned in this file? *(β†’ RAG QA Agent)*
1823
+ 5. Compare the proposals in DocA and DocB. | Summarise all files. | Is DocA one of the project in the DocB or DocC. | Which argument is stronger across these files? | Do these documents mention similar policies? | What's the difference between the files? *(β†’ AutoGen)*
1824
+ 6. What is LangChain used for? | What are the latest trends in AI startups in 2025? | Tell me the most recent breakthrough in quantum computing. *(β†’ Online Rag Agent)*
1825
+
1826
+ > Built for users who need clear, explainable, and context-aware answers β€” whether you’re working on documents in law, finance, research, or tech.
1827
  """
1828
 
1829
 
1830
 
1831
  demo = gr.TabbedInterface(
1832
  interface_list=[
1833
+ gr.Interface(
1834
+ fn=langgraph_tab6_main,
1835
+ inputs=[
1836
+ gr.Textbox(label="Ask anything"),
1837
+ gr.File(label="Upload one or more files", file_types=[".pdf", ".txt", ".docx"], file_count="multiple")
1838
+ ],
1839
+ outputs="text",
1840
+ title="Smart Multi-Doc QA (LangGraph + AutoGen)",
1841
+ allow_flagging="never",
1842
+ description=demo_description6
1843
+ ),
1844
  gr.Interface(
1845
  fn=multi_agent_chat_advanced,
1846
  inputs=[
1847
  gr.Textbox(label="Enter your query"),
1848
+ gr.File(label="Upload file (CSV, PDF, TXT, DOCX)", file_types=[".pdf", ".txt", ".docx"], file_count="single")
1849
  ],
1850
  outputs="text",
1851
  title="Multi-Agent AI Assistant",
 
1854
  ),
1855
  gr.Interface(
1856
  fn=document_summarize,
1857
+ inputs=[gr.File(label="Upload PDF, TXT, or DOCX",file_types=[".pdf", ".txt", ".docx"])],
1858
  outputs="text",
1859
  title="Document Summarisation",
1860
  allow_flagging="never",
 
1862
  ),
1863
  gr.Interface(
1864
  fn=upload_and_chat,
1865
+ inputs=[gr.File(label="Upload PDF, TXT, or DOCX"), file_types=[".pdf", ".txt", ".docx"], gr.Textbox(label="Ask a question")],
1866
  outputs="text",
1867
  title="Your Docs Q&A (Upload + GPT-4 RAG)",
1868
  allow_flagging="never",
 
1884
  allow_flagging="never",
1885
  description=demo_description
1886
  ),
1887
+
 
 
 
 
 
 
 
 
 
 
1888
  ],
1889
  tab_names=[
1890
+ "Smart Multi-Doc QA (LangGraph + AutoGen)",
1891
  "Multi-Agent AI Assistant",
1892
  "Document Summarisation",
1893
  "Your Docs Q&A (Upload + GPT-4 RAG)",
1894
  "Biden Q&A (GPT-4 RAG)",
1895
  "Biden Q&A (LLaMA RAG)",
1896
+
1897
  ],
1898
  title="Smart RAG + Multi-Agent Assistant (with Web + Document AI)"
1899
  )