Inspiration
Organic farms offer benefits for climate, sustainability, and human health. However, the regulatory process for USDA organic is complicated and hard to understand. Producers must have their farms certified by accredited auditors. The process of transitioning organic typically takes 3-5 years.
What it does
We imagine a platform that connects together auditors and farmers through designated workflows. For this hackathon, we built a feature for such a platform. A chatbot that could help farmers understand the regulation / the requirements of the workflow.
How we built it
We built the chatbot using chromadb, langchain, and oai. We downloaded the regulations associated with USDA organic farming (7 CFR 205) and loaded them into chromadb, using its default embeddings.
We then wrote a series of prompts for gpt-3.5-turbo to encourage it to write useful responses to user queries. When a user makes a query, we take the top 2 responses from chromadb, associated with the query, and put them into the prompt for gpt-3.5-turbo.
We then use chain of thought reasoning to encourage the model to be discursive and to brainstorm the reasons why the user might be asking the question, possible interpretations of the question, ways in which the documents might interact with the questions, etc... and then use gpt-3.5-turbo again to extract the answer from its brainstorming.
For demonstration purposes, we are using streamlit to show a conversation.
Challenges we ran into
The answers that we got were often not useable by a non-specialist, so we had to do work with the prompt to improve the quality of the answers.
Context length remains an issue. With a 4k context length, you cannot provide large sections of the law to the model. We could shift to using other services like gpt-4 or claude-v1.3 but at an increase of cost.
Latency remains an issue. Even gpt-3.5-turbo is slow and produces a bad user experience if a user is waiting for a query.
Accomplishments that we're proud of
We have a working chat bot with access to the 7 CFR 205 regulation that can produce useful answers.
What we learned
Right now, language models are useful to augment a workflow and can help simplify complex text, but they have limitations.
What's next for Diaita
If this were to be a product, we would begin defining user workflows, creating a website to manage user workflows, and marketing the product to organic auditors and farmers looking at organic farming.
Built With
- chromadb
- oai
- python
Log in or sign up for Devpost to join the conversation.