FinplifAI is a RAG-based multiagent chat system designed to assist users with accounting and finance queries in accordance with Spanish state regulations. The platform leverages advanced language models and retrieval-augmented generation to provide accurate, contextually relevant financial guidance.
FinplifAI implements a sophisticated architecture with the following key components:
The core of FinplifAI is built on Retrieval-Augmented Generation (RAG), which enhances LLM responses by:
- Dynamic retrieval of relevant financial and accounting regulations
- Contextual augmentation of prompts with domain-specific knowledge
- Vector storage of Spanish financial regulatory frameworks
- Real-time document processing capabilities
The platform employs a multi-agent architecture that coordinates specialized components:
- Primary conversational agent (finance/accounting expert)
- Legal information retrieval agent
- Code generation agent for financial calculations
- Document processing agent for analyzing uploaded financial documents
-
Next.js App Router
- Server Components (RSCs) for optimal rendering strategy
- Server Actions for secure, server-side mutations
- Advanced routing for complex application flows
-
- Framework-agnostic API for LLM interactions
- Streaming response handling with structured outputs
- Provider flexibility with support for xAI (default), OpenAI, Groq, and other providers
-
shadcn/ui Components
- Accessible component primitives from Radix UI
- Styled with Tailwind CSS for consistent design language
- Customizable component system optimized for finance applications
-
Model Providers
- Primary: OpenAI (o3-mini, o4-mini)
- Alternative: xAI (grok-2-1212)
- Specialized: Groq (deepseek-r1-distill-llama-70b)
-
RAG Implementation
- Custom vector storage for Spanish financial regulations
- Domain-specific embeddings for accounting terminology
- Hybrid retrieval system combining semantic and keyword search
-
Vercel Postgres powered by Neon
- Storage for conversation history
- User profile and preference management
- Vector embeddings for rapid retrieval
-
- Document storage for uploaded financial files
- Support for multiple document formats (CSV, PDF, spreadsheets)
- NextAuth.js
- Secure authentication flows
- Role-based access control for enterprise usage
- Multi-tenant support with organization boundaries
- Bilingual interface with primary focus on Spanish language
- Real-time financial calculations with embedded Python code execution
- Integration with Spanish accounting standards and tax regulations
- Document analysis for financial statements and reports
- Responsive design for desktop and mobile access
- Artifact generation for code, spreadsheets, and documentation
- Node.js 18.x or later
- Vercel account (for deployments and environment variables)
- Access to required AI model providers
-
Clone the repository
git clone https://github.com/poacosta/finplifai.git cd finplifai -
Install Vercel CLI
npm i -g vercel
-
Link your local instance with Vercel and GitHub accounts
vercel link
-
Download your environment variables
vercel env pull
-
Install dependencies
pnpm install
-
Start the development server
pnpm dev
The application should now be running at http://localhost:3000.
Create a .env.local file with the following variables:
# Database
DATABASE_URL="postgres://..."
# Authentication
NEXTAUTH_SECRET="your-secret"
NEXTAUTH_URL="http://localhost:3000"
# AI Providers
OPENAI_API_KEY="your-openai-key"
XAI_API_KEY="your-xai-key"
GROQ_API_KEY="your-groq-key"
FinplifAI is optimized for deployment on Vercel:
vercel deploy