This repository contains both the backend (FastAPI) and frontend (Next.js) for the GovernomicsCR application.
This study introduces GovernomicsCR, an AI driven analytical system designed to examine and compare Costa Rica’s economic growth across presidential administrations. The system integrates structured datasets, a multi agent pipeline orchestrated with LangGraph, Langchain, and a FastAPI backend for automated report generation. Additionally, a React based frontend using the shadcnui component library provides an interactive interface that allows users to formulate queries, select predefined questions, and receive structured analytical outputs.
GovernomicsCR processes historical GDP data, synthesizes sectoral, industrial, regime based, and expenditure related indicators, and produces coherent analytical reports. The results show the feasibility of using large language models to support economic monitoring and policy analysis.
.env: Environment variables (not tracked by Git)requirements.txt: Python dependenciesapp/:agents/api/clients/core/data/models/pipelines/prompts/services/utils/
- Next.js project bootstrapped with
create-next-app app/: Main pages and componentsassets/: Static resources (CSS, images, etc.)notebooks/: Jupyter notebooks for analysisscripts/: Utility scriptsdata/: Frontend data files
python -m venv .venv
# Windows
.venv\Scripts\activate
# macOS/Linux
source .venv/bin/activatepip install -r requirements.txtCreate a .env file in the root of be_government with:
GROQ_API_KEY="your_groq_api_key"
OPENAI_API_KEY="your_openai_api_key"
uvicorn app.main:app --reloadcd fe_government
npm installnpm run dev
# or
yarn dev
# or
pnpm dev
# or
bun devOpen http://localhost:3000 in your browser to view the app.
- Entry point:
main.py - Modify logic in
app/and add services, agents, or endpoints as needed - Run tests in
tests/
- Edit pages in
app/page.tsxor components inapp/ - Changes are reflected automatically in the browser
- Run locally using Uvicorn (see above)
- For production, deploy using your preferred Python hosting solution
- The easiest way to deploy Next.js is on Vercel
- See Next.js deployment documentation