How afinch21/somerville works
Main Components
a) Frontend Layer:
• NiceGUI-based frontend application
• Connection to FastAPI backend through HTTP requests
• Main UI components mentioned (Plan, Extract, Operations, and Evaluation tabs)
b) Backend Layer:
• FastAPI server
• API endpoints (/get_question_list, /answer_question, /get_evaluation)
• Core business logic components
c) Agent Layer:
• Two LLM agents
• OpenAI API integration
• Agent workflow orchestration
d) Data Layer:
• PostgreSQL database (optional)
• JSON file storage (alternative)
• Data models and ORM
Component Organization
[Frontend Layer (NiceGUI)] ↔ [Backend Layer (FastAPI)] ↔ [Agent Layer] ↔ [Data Layer]
Frontend Layer:
[UI Components]
• Plan View
• Extract View
• Operations View
• Evaluation View
Backend Layer:
[FastAPI Server]
• API Endpoints
• Model Definitions
• Utility Services
• AppStartup
• PromptTemplates
• ProcessEvalResults
Agent Layer:
[Agent System]
• Agent Archetypes
• Agent Workflow
• Operation Executor
• OpenAI API Integration
Data Layer:
[Storage]
• PostgreSQL Database
• ORM Models
• JSON File Storage
• ConvFincQA_data.json
• agents.json
• prompts.json
Important Flows to Highlight
a) Question Processing Flow:
UI → API → Agent Workflow → LLM Processing → Data Storage → Response
b) Evaluation Flow:
Request → Data Retrieval → Agent Processing → Result Comparison → Evaluation Summary
Technical Details
• Port configurations (80 for API)
• Database connection string format
• File storage paths
• API endpoint specifications
• Environment variable dependencies
Recommendations
• Version information for major components
• Notes about scalability points
• Document error handling paths
• Configuration dependencies