Background
Previously, the web pages in AIAgent projects were built using Html+Css+Js, in one word: ugly.
Choice
FastAPI + Gradio for quickly building attractive UIs
Below is the UI for RAG visualization:

The code is very simple, as follows:
https://github.com/LuochuanAD/Fine-tuning-Learn/tree/main/FastAPI%2BUvicorn%2BGradio_Demo
Trade-offs
Use cases for Gradio
- Creating AI demos
- Building internal tools
- Rapid prototyping (MVP)
- Agent debugging interfaces
- RAG visualization
Limitations (when using Gradio)
- Limited UI customization capabilities
- Limited complexity for frontend interactions
- Not suitable for production-level ToC products
Future
In the future, I plan to use Next.js + FastAPI to build the frontend and backend of a ToC AIAgent.