How pruthvi3715/vois-elida works
1. System shape
ELIDA is a two-tier product: a React/Vite frontend for user interaction and a FastAPI backend for all analysis, auth, and data access. The backend is not just a CRUD API; it is the execution layer for a multi-agent investment analysis pipeline that combines market data, user profile data, and LLM-based reasoning.
2. Frontend boundary
The frontend is organized around page-level workflows: Dashboard, Analysis, Portfolio, History, Profile, Learn, Login/Register, Comparison, Settings. Shared UI pieces like charts, match score cards, agent cards, and regret warnings indicate that the UI is centered on presenting analysis results rather than editing content. AuthContext and AnalysisContext act as the main client-side state boundaries for identity and in-flight analysis data.
3. Backend application boundary
backend/app/main.py is the FastAPI entrypoint, while core/ contains cross-cutting concerns: configuration, logging, security, and centralized error handling. database.py and models/ define persistence boundaries, separating API orchestration from stored user/profile/history data.
4. Authentication subsystem
Authentication is isolated under backend/app/auth/, with service, routes, and dependencies split cleanly. The presence of JWT-oriented security utilities and dependency injection suggests protected endpoints for user-specific features such as profile and history. On the frontend, protected routing is enforced through ProtectedElement.
5. Domain model: Investor DNA
A key domain concept is Investor DNA, modeled in models/investor_dna.py. This is the personalization layer used to score how well an investment aligns with a user’s risk tolerance, time horizon, goals, and sector preferences. This model is a central input to the match-score and coaching logic, not a UI-only feature.
6. Multi-agent analysis pipeline
The backend’s agents/ package defines the core intelligence layer: Scout, Quant, Macro, Philosopher, Regret, Coach, all built on a shared base. The agents represent distinct analytical lenses: data collection, fundamentals, macro context, quality/ethics, behavioral risk, and final synthesis. orchestrator.py is the coordination boundary that likely sequences these agents and merges their outputs into one analysis response.
7. Service layer responsibilities
Most business logic lives in services/. This layer includes market-data adapters (coingecko_service, fred_service, ticker_search_service), LLM/RAG support (claude_service, rag_service, finance_knowledge_base), scoring and personalization (match_score_service, score_labels), and quality controls (data_validator, sanity_checker). The service layer is where the backend integrates external sources and normalizes them into analysis-ready inputs.
8. Behavioral finance and risk simulation
The regret agent plus regret-related UI components show that the system explicitly models loss aversion and worst-case outcomes, not just upside. This behavioral layer feeds the final recommendation and the displayed warnings, making the architecture distinct from a traditional stock screener. In diagram terms, this is a separate analysis branch that influences the final coach synthesis.
9. User-facing API slices
API routing is split by concern: auth/, routers/profile.py, and routers/history.py. This implies a clean separation between identity, personalized investor settings, and stored analysis history. The frontend pages likely consume these endpoints to populate the Profile and History experiences, while analysis pages call the orchestration endpoint(s) for live evaluation.
10. Persistence and caching
The system uses SQLite + SQLAlchemy for durable app data, with a separate cache_service and demo_cache.py for performance and demo-friendly responses. There is also a data/history.json seed/sample dataset, which suggests a lightweight local data source for prototypes or historical examples. The architecture therefore has three storage concerns: relational user/history data, cached responses, and external market/RAG data.
11. External data and AI dependencies
The README and service names indicate integration with LLM providers and external market-data APIs. The architecture explicitly supports an LLM fallback chain and uses RAG for factual grounding, so the backend depends on both live financial data and a vector/knowledge store. In a diagram, these are external dependencies feeding the service layer rather than direct frontend integrations.
12. Quality, testing, and documentation boundaries
Tests cover the key seams: agents, auth, and orchestrator behavior. The repo also contains extensive docs for architecture, API reference, workflows, and presentation material, which suggests the system is intentionally documented as a teaching/demo platform. That makes the architectural boundaries relatively stable and explicit: UI, auth, orchestration, domain scoring, data adapters, and persistence.
Main entry points: services Services · main.py API app · pages Workflows · main.tsx App shell
Components 20
Frontend
React/Vite UI, client state, and page workflows.
- App shell · Bootstraps the Vite app and global layout/routing.
frontend/src/main.tsx - Auth state · Holds identity and login state for protected flows.
frontend/src/context/AuthContext.tsx - Analysis state · Tracks in-flight analysis and result state.
frontend/src/context/AnalysisContext.tsx - Workflows · Dashboard, analysis, portfolio, history, profile, learn, comparison, and settings screens.
frontend/src/pages - UI widgets · Charts, score cards, warnings, chatbot, and layout pieces for analysis presentation.
frontend/src/components - Protected routes · Blocks authenticated pages until login succeeds.
frontend/src/components/auth/ProtectedElement.tsx - API client · Frontend gateway for backend calls.
frontend/src/api.js
Backend
FastAPI app, orchestration, services, and persistence.
- API app · Creates the FastAPI application and registers routes.
backend/app/main.py - Core · Configuration, logging, security, and error handling.
backend/app/core - Auth · JWT-oriented auth routes, services, and dependencies.
backend/app/auth - Orchestrator · Coordinates the agent pipeline and assembles analysis output.
backend/app/orchestrator.py - Agents · Scout, Quant, Macro, Philosopher, Regret, and Coach analysis lenses.
backend/app/agents - Services · Market-data adapters, scoring, RAG, validation, caching, and portfolio/history helpers.
backend/app/services - Models · Database models and Investor DNA personalization model.
backend/app/models - Database · SQLAlchemy-backed durable app storage.
backend/app/database.py - Profile/History APIs · User-specific API slices for profile and history data.
backend/app/routers - Cache · Cached and demo-friendly responses for performance and repeatability.
backend/app/services/cache_service.py
External
Third-party data, AI providers, and storage dependencies.
- Seed history · Local historical sample data used for demos and bootstrapping.
backend/data/history.json - LLM API · Third-party language model provider used for reasoning and synthesis.
- Market data · External market and macro data sources such as CoinGecko, FRED, and ticker search.
Connections 22
- App shell → Auth state: wraps · Provides auth state to the app.
- App shell → Analysis state: wraps · Provides analysis state to the app.
- App shell → Workflows: routes to · Renders page-level workflows.
- Workflows → UI widgets: uses · Composes shared presentation components.
- Workflows → Protected routes: guards · Protects authenticated routes.
- Workflows → API client: calls · Fetches backend data and submits analysis requests.
- Protected routes → Auth state: reads · Checks user identity state.
- API app → Core: loads · Applies configuration, logging, security, and errors.
- API app → Auth: mounts · Registers authentication endpoints.
- API app → Profile/History APIs: mounts · Registers profile and history APIs.
- API app → Orchestrator: exposes · Serves analysis execution endpoints.
- Orchestrator → Agents: coordinates · Sequences specialist agents and merges outputs.
- Orchestrator → Services: depends on · Uses scoring, RAG, validation, and data adapters.
- Services → Market data: fetches · Pulls live market and macro inputs.
- Services → LLM API: queries · Uses LLM reasoning and synthesis.
- Services → Cache: reads/writes · Caches repeatable responses and demo data.
- Services → Models: uses · Transforms domain objects and persisted records.
- Models → Database: persists via · Stores relational app data through SQLAlchemy.
- Profile/History APIs → Services: delegates · Routes profile and history operations into services.
- Auth → Core: uses · Relies on shared security and error handling.
- Auth → Models: uses · Reads and writes user/auth-related records.
- Services → Seed history: loads · Uses sample history data for local/demo flows.