Sinaptik-AI / pandas-ai

Chat with your database (SQL, CSV, pandas, polars, mongodb, noSQL, etc). PandasAI makes data analysis conversational using LLMs (GPT 3.5 / 4, Anthropic, VertexAI) and RAG.
https://pandas-ai.com
Other
13.02k stars 1.26k forks source link

Web Interface for PandasAI #138

Closed victor-hugo-dc closed 4 months ago

victor-hugo-dc commented 1 year ago

As mentioned on the README, there's a want to create a web interface for PandasAI. I feel that this would be pretty neat and would allow less technically inclined people to harness the power of pandas by simply uploading their file, providing their API token and writing their prompt. My questions are mainly design questions; would we want this to be a part of the repository or be a separate repository in it of itself, also what framework would we want to write it in? My gut says Flask would be easiest. Let me know your thoughts.

lee101 commented 1 year ago

Also checkout https://askFelix.ai :)

gventuri commented 1 year ago

Hey @victor-hugo-dc, that's a very good question. We are already working on that. We're using NextJS for the frontend as it's quite a standard, but we are super open to consider any python framework for the backend (either flask of fastapi, the most lightweight one ideally).

If anyone wants to join the efforts and support the UI / backend, please ping me on discord (you can join from here, if you haven't https://discord.gg/AZRDpK4vt9)!

amjadraza commented 1 year ago

@victor-hugo-dc @gventuri
I hav developed a Skelton App using Streamlit and pandasai . Below is the Link to Project, I am planning to host it for Quick testing. We have to add more features to cover as implemneted in pandasAi. Any feedbacks are most welcomed. https://github.com/amjadraza/pandasai-app

rogerfn commented 1 year ago

gventuri How are you planning to send the images to the frontend, have you consider use Plotly ? I did some test on it and using its JSON representation one can render the graph in React

Lasekx95 commented 1 year ago

I'm not too familiar with python backends but I can start on a front-end using NextJS and maybe tailwind. I can create some lofi wireframes for the design. We could do a separate repo then merge everything down the road.

victor-hugo-dc commented 1 year ago

At the moment we have the following working: https://pandas-ai.streamlit.app/ however the limitation is that it doesn't support multiple chats and it doesn't persist the users questions/pandasai's responses once the page has been refreshed. I'd love to see a possible solution in NextJS, I will say that it's a bit tricky to get the graphs to the front-end but I was able to manage: https://github.com/victor-hugo-dc/pandasai-chat

Lasekx95 commented 1 year ago

Graph's are easy enough to do. Just need to use ChartJS and call the data as Json or CSV, similar to this https://github.com/Lasekx95/Teck-Fuel-Consumption-Web-App/blob/main/teck-app/components/fuel-mile-chart.tsx

Mind you that data is hard coded but shouldn't be too hard to call it from a Db, I can look into it though. As for the persistence, first thing that comes to mind is using something similar to a game loop that stores the data in the user's cache. I work full-time while attending uni part-time for compsci so I'm nowhere near a pro but I can take a crack at creating something in NextJS and go from there.

Lasekx95 commented 1 year ago

Now the question, do you guys want a separate repo for a NextJS solution, or to branch onto the current UI repo?

aiakubovich commented 1 year ago

Few days ago streamlit introduced native chatbot support: https://docs.streamlit.io/knowledge-base/tutorials/build-conversational-apps

Also it looks like new chat functionality supports dataframes/images in chat as well.

Here is example with generation of dataframe in chat (using snowflake snowpark but it should be very similar with PandasAI)(https://quickstarts.snowflake.com/guide/frosty_llm_chatbot_on_streamlit_snowflake/#5): image

Streamlit Chart elements (https://docs.streamlit.io/library/api-reference/charts) also should work. Example: https://zenn.dev/t_kakei/scraps/92264f6f8a9ad3

gventuri commented 1 year ago

@aiakubovich thanks a lot for reporting. We are working on the "official" streamlit gui, this is definitely a game changer. Thanks a lot for sharing!