Project Details

Year: 2025
Role: Full Stack Developer
Status: Completed
Authors:
Jesús Baena

Tech Stack & Skills

{ "Backend": "n8n, Flowise" }{ "AI Models": "OpenAI, Google Gemini" }{ "Databases": "Supabase (Vector Store), Postgres" }{ "APIs & Services": "SerpAPI, DeepL, Llama Cloud Parser" }{ "Integrations": "Google Drive, Google Sheets" }

Links & Resources

Project Overview

The Goal

The core goal is to provide humanitarian workers in Ukraine with a free, accessible tool to quickly understand the complex and rapidly changing legal landscape, thereby saving time and optimizing legal consultation costs.

The Solution

An AI-powered online advisor that acts as a preliminary legal guide. It uses a sophisticated two-agent Retrieval-Augmented Generation (RAG) system that queries a specialized database of Ukrainian legislation and falls back to a web search to provide synthesized, sourced answers to legal questions relevant to humanitarian operations.

Key Objectives

  • Provide preliminary guidance on common topics like NGO registration, conscription, import regulations, and the implications of martial law.
  • Optimize legal expenses by helping organizations better prepare for and frame inquiries with professional legal counsel.
  • Ensure reliability by prioritizing information from a curated database of official legal texts and providing source citations for verification.

Audience & Stakeholders

  • Primary Users: Field managers, program staff, and administrative personnel of local and international humanitarian NGOs operating in Ukraine.
  • Key Stakeholders: The broader humanitarian community in Ukraine and organizations committed to promoting the rule of law.

The Plan & Key Features

Overall Approach

The project was built using a mix of low-code and custom-coded components. The core of the system is a sequential two-agent chain built in Flowise. This RAG system first queries a curated, specialized vector database (Supabase) for high-relevance answers and intelligently falls back to a general web search (SerpAPI) to ensure comprehensive coverage.

Core Components

  • Knowledge Base: A custom-built vector database containing Ukrainian laws, decrees, and official documents, processed through a custom Python translation pipeline.
  • Two-Agent RAG System: 1. A "Compiler" agent that analyzes user queries and searches the knowledge base or the web. 2. A "Refiner" agent that synthesizes the retrieved information into a coherent answer with source citations.
  • Automation Backend: A self-hosted n8n workflow that orchestrates the data flow between the user interface and the AI system.
  • Web Interface: A simple HTML, CSS, and JavaScript frontend for user interaction.

Timeline & Deliverables

Major Milestones

  • Phase 1: Knowledge Base Creation (Data collection, translation, and vectorization).
  • Phase 2: Development of the two-agent AI system using Flowise and n8n.
  • Phase 3: Deployment of the live web application and public release.

Final Deliverables

  • A link to the live, publicly accessible online legal advisor.
  • The final source code repository on GitHub.
  • A technical article detailing the construction of the knowledge base and the system's architecture.
baena.ai