System Documentation
Product Overview
CHAIN-R is a privacy-first LLM-as-a-service platform. It lets users, developers, and organisations manage, monitor, and customise AI agents, knowledge bases, and multi-agent workflows through a unified web interface and API.
Core Concepts
| Concept | Description |
|---|---|
| Agents | Custom AI agents with a fixed system prompt, assigned model, and optional skills, knowledge bases, and specialist tools. |
| Skills | Multi-agent DAGs built with LangGraph. Each node runs a worker agent; edges define sequential or conditional flow. |
| Workers | Individual worker agents that extend a built-in role (analyzer, reviewer, planner, etc.) with custom prompts and tools. |
| Knowledge | Knowledge bases backed by document stores (MinIO + Qdrant for RAG) or graph databases (Neo4j). Assigned to agents for context at inference time. |
| Tools | Named callable capabilities exposed to agents and workers at runtime. General tools are auto-injected; specialist tools are explicitly assigned. |
| Activity | Per-invocation log of all LLM calls across models and agents — token usage, latency, trace. |
Application Sections (fe-core)
| Route | Section |
|---|---|
/user/activity | Activity — LLM invocation log |
/user/inference | Inference — models, agents, skills, workers |
/user/knowledge | Knowledge — document and graph knowledge bases |
/user/tools | Tools — custom tool definitions |
/user/evaluation | Evaluation — A/B experiments and test suites |
/user/projects | Projects |
/user/organisations | Organisations |
/developer/ | Developer — design preview only (example data, not in the navigation) |
This section provides comprehensive documentation about the Chainr system architecture, deployment processes, and API interfaces.
🏗️ Architecture Overview
System Architecture - High-level system design and component relationships
Technology Stack - Frameworks, languages, and tools used
🔧 Services & Components
Core Services
Authentication Service (svc-auth) - User authentication and authorization
Backend-for-Frontend (svc-bff) - API aggregation and client optimization
Core Service (svc-core) - Business logic and data management
AI Service (svc-ai) - Machine learning and AI capabilities
Infrastructure
🗄️ Data & Storage
Database Schema - Database design and relationships
Data Models - Entity definitions and data structures
Caching Strategy - Cache implementation and policies
Timestamps - UTC storage, the offset every response carries, and how clients read it
User data export - What Settings → Data → Download your data holds, how rows are chosen, and what it leaves out
🔒 Security
Authentication Flow - Login and session management
Authorization - Access control and permissions
API Security - Endpoint protection and validation
Environment Security - Secrets and configuration security
Dependency Scanning - Lockfile vulnerability scanning (osv-scanner, npm audit)
📊 Monitoring & Observability
Logging - Log collection and analysis
Health Checks - Service health monitoring
Metrics - Performance and usage metrics
Error Tracking - Exception handling and debugging
⚙️ Configuration
Environment Variables - Configuration reference
Configuration Files - Setup and deployment configs
Feature Flags - Feature toggles and rollout management
🐛 Troubleshooting
Common Issues - Frequently encountered problems
Debug Procedures - Debugging workflows and tools
Performance - Optimization and bottleneck identification
🚀 Deployment
Deployment Guide - Infrastructure setup, containerization, and deployment strategies
Cloudflare Tunnel - The outbound-only edge connector: setup, cutover, decommissioning the direct path, and operating it
🔗 API Interfaces
API Documentation - Service interfaces, endpoints, and integration guides
For developer guides, see ../guides/\_.md. For general project information, check ../../README.md.