How sirocco-ventures/raggenie works
Based on our analysis of the file tree and the README, RAGGENIE is a low-code, open-source tool that enables users to quickly build conversational AI applications using a Retrieval Augmented Generation (RAG) approach. The project provides both a backend API (written in Python) and a frontend application (built with a React/Vite stack) as well as modular support for plugins, various data connectors, multiple LLM inference providers, and vector database integrations.
Main Components
• Frontend/UI Layer: This resides in the “ui” directory. It involves the chat widget, configuration pages, dashboards, and other components for user interaction. Mention that it communicates with the backend API via REST calls.
• Backend/API Layer: Found in the “app” directory. Key subfolders include:
– “app/api/v1”: Contains the API endpoints (e.g., auth, llmchat, connector, provider).
– “app/chain”: Contains several chain modules that orchestrate the conversation flow, capability logic, context/retrieval management, and post-processing.
– “app/base”: Contains abstract classes and base classes for plugins, LLMs, formatters, and data connectors. This indicates a plugin architecture.
– “app/embeddings”, “app/loaders”, “app/plugins”, and “app/vectordb”: These directories implement integrations with external providers (e.g., OpenAI, Cohere, Google) and connect to different data sources or vector databases.
– “app/providers”: Provides middleware, caching, configuration management, and container handling.
– “app/models”, “app/repository”, “app/schemas”, and “app/services”: Manage data models, persistence interactions, and business logic.
• External Services & Infrastructure:
– LLM Inference APIs (OpenAI, Gemini, Claude, and Together.ai) are supported.
– Data connectors and plugins enable integration with structured data sources like databases (MySQL, PostgreSQL, etc.) as well as document-based sources.
– A vector database (for example, Chroma as configured in “config.yaml”) is used to store and query embeddings.
– Zitadel is used for authentication and identity management. The Docker Compose files (e.g., zitadel-docker-compose.yaml) and instructions indicate how to run and configure this external service.
• Utility and Configuration Components:
– Environment setup using configuration files (config.yaml, .env).
– Deployment files: Dockerfile, docker-compose.yml, and Makefile.
– Testing suites in the “tests” directory ensure both functional and integration tests.
Establish the Relationships and Interactions
• Backend API as a central component broken into several submodules:
– API endpoints (handling incoming HTTP/S requests).
– Chain modules that process conversational logic by interacting with the various plugins and loaders.
– Plugins and connectors that interface with external data sources (structured and unstructured).
– Embedding and vector database modules for storing/retrieving context.
– From the UI to API endpoints.
– From the API to chain modules where data is processed and routed.
– From chain modules to:
• External LLM providers (for inference calls).
• Data source connectors/plugins (which in turn may connect to databases or document storage).
• Vector DB components (e.g., Chroma or MongoDB) for efficient retrieval.
• Optionally, show a side note for utility modules (configuration reading, JWT utilities, etc.) that support the core functionality.
Architectural Patterns and Design Principles
• Separation of Concerns: Clearly show that the frontend (UI) is decoupled from the backend. Also, the backend further separates API routing, business logic (chains and services), and integration layers (plugins, connectors).
Relevant Technologies and Frameworks
• Python is used in the backend. Note the use of standard libraries and frameworks (e.g., Flask or FastAPI might be assumed based on the API structure).
• UI is built using React (in combination with Vite) and managed with npm, as seen in the “ui” directory.
• Docker and Docker Compose are used for deployment (Dockerfile, docker-compose.yml, and zitadel-docker-compose.yaml).
• Various third-party libraries: For vector databases (Chroma), embeddings (OpenAI, Cohere, Google), and others.
Putting It All Together
• Ancillary components such as configuration files, testing modules, and deployment scripts as supporting elements on the periphery if needed.