What Inspired Us
The inspiration for EconoRise came from a fundamental paradox: in a world overflowing with data and advanced financial technology, a significant portion of the global population, particularly small-scale entrepreneurs in developing countries, remains financially excluded. Traditional lending models are rigid, often requiring collateral or a formal credit history that these individuals simply don't have. This gap in access to capital stunts economic growth and perpetuates cycles of poverty. We were inspired to build a solution that could leverage cutting-edge technology to solve this real-world economic problem, providing a platform where a business's true potential, rather than its formal history, could be assessed.
What We Learned
Hacknomics was a deep dive into the intersection of economic theory and practical technical execution. We learned that:
- Financial Inclusion is a Technical Challenge: Democratizing access to capital isn't just about good intentions; it requires robust technical infrastructure. We learned how to use APIs like Plaid to access financial data and integrate economic insights from FRED and the World Bank to add context to our models.
- The Power of LLMs for Structured Output: We discovered that while large language models are great for free-form text, their real power in a structured application lies in their ability to generate predictable, JSON-formatted output. This was crucial for our loan assessment API, allowing us to generate reliable data for our front-end.
- Debugging is a Learning Process: From
ModuleNotFoundErrorto subtle JSON parsing issues, we faced a series of technical hurdles. Each challenge, like a 403 Forbidden error from the Nasdaq Data Link API, taught us how to diagnose problems, find workarounds (e.g., switching to publicly available datasets), and read API documentation more carefully.
How We Built It
Our project was built as a full-stack application with a clear separation of concerns.
- Backend API (Flask): The core logic is a Flask API that serves as the brain of the operation. It uses LiteLLM as an abstraction layer to connect with various large language models (starting with Gemini, then moving to Ollama and finally Mistral AI to avoid rate limits). Pydantic was essential for validating the structured JSON output from the LLMs. The API also integrates with external services like FRED and Nasdaq Data Link to enrich the data.
- Frontend (Next.js): The user interface was developed using Next.js. We created a dynamic, multi-step form for loan applications and a dashboard for lenders. The frontend makes asynchronous calls to our Flask API to get real-time data and present the AI-powered assessments.
- Tools & Libraries: Our technology stack included
requestsfor fetching data from external APIs,pandasfor handling dataframes, andjsonfor parsing structured output. The development process was driven by an iterative cycle of coding, testing, and debugging, with a focus on creating a robust and functional prototype.
Challenges We Faced
We encountered several significant challenges throughout the hackathon:
- API Rate Limits and Costs: Initially, using the Gemini API led to frustrating rate limits, which hindered our development and testing. We pivoted to a local Ollama setup with Llama 3 to continue development without interruption. For our final submission, we opted for the Mistral AI API, which offers a better price-to-performance ratio and generous limits.
- Data Parsing and Formatting: A major technical hurdle was the inconsistent output from the LLMs. The models would often wrap the JSON in markdown, causing
JSONDecodeErrors. We had to implement a specific data-cleaning step to strip the markdown before parsing. - API Compatibility and
ImportErrors: We faced multipleImportErrorandAttributeErrorissues with the Plaid library due to version updates. Debugging these required careful reading of the official documentation on GitHub to ensure our code was compatible with the latest library structure. This reinforced the importance of using up-to-date resources. - Dataset Access Restrictions: We discovered that many seemingly public datasets on platforms like Quandl have access restrictions, leading to 403 Forbidden errors. We overcame this by switching to publicly available, well-documented datasets and using the correct API methods for each data type.
Built With
- flask
- fredapi
- html
- javascript
- litellm
- mistralai
- nasdaq-data-on-demand
- next
- python
- quandl
- tailwind
- typescript
Log in or sign up for Devpost to join the conversation.