Welcome to ComplyAIgent! This guide will walk you through setting up your local environment for development and testing.
ComplyAIgent is composed of three primary components:
- Backend (
/backend): A FastAPI service powering rule ingestion, classification pipelines (via LangChain), and policy validation logs. Powered by SQLModel/SQLAlchemy (configured with SQLite or PostgreSQL). - Frontend (
/frontend): A Next.js (App Router) dashboard to upload policies, track compliance history, and approve/reject medium-risk pushes paused by LangGraph. - CLI (
/cli): A Go command-line tool (pg) serving as a git pre-push hook. It executes fast, local-first scans (Gitleaks, regex, and entropy check) and offloads complex validation to the backend.
Ensure you have the following installed on your system:
- Go (v1.20 or newer)
- Python (v3.11 or newer) and uv (fast Python package installer/manager)
- Node.js (v18 or newer) and npm or pnpm
- Docker & docker-compose (optional, for local postgres/services container setup)
The backend uses uv for python package management.
# Navigate to the backend directory
cd backend
# Sync dependencies and create a virtual environment
uv sync
# Copy the example environment file from the root
cp ../.env.example .envOpen .env and configure the settings. If you don't have active LLM keys, you can run integration tests or preview mock configurations.
To start the FastAPI dev server:
uv run fastapi dev main.pyBy default, the server runs on http://localhost:8000. You can verify it by hitting http://localhost:8000/health.
The frontend is a Next.js client.
cd frontend
# Install packages
npm install # or pnpm install
# Start the dev server
npm run devThe client runs on http://localhost:3000. It communicates with the backend API on http://localhost:8000. If the backend is down, the frontend automatically falls back to static mock data so you can preview the UI.
Build and install the Go CLI tool (pg):
cd cli
# Build the binary
make build
# Install the binary locally (adds to ~/.local/bin/pg)
make installNote: Make sure ~/.local/bin is in your $PATH.
To initialize ComplyAIgent in a repository:
# In the root of the repository you want to monitor
pg initThis will create a .pg.yaml configuration file and automatically configure a git pre-push hook at .git/hooks/pre-push.
An integration test suite is located in /scripts to test the end-to-end flow.
To run tests:
# From the project root
./scripts/integration-test.shNote
LLM clients are lazy-loaded (PR #63), so missing API keys should no longer crash import/startup. You still need real or mock credentials for paths that call the LLM. See Audit and Handover.
MVP context: docs/mvp/README.md · ROADMAP