Skip to main content

Recon Agent — Multi-Tenant SaaS

AI-powered financial reconciliation as a multi-tenant SaaS.

Architecture

  • Frontend: Next.js 16 + Clerk auth (App Router)
  • Backend API: FastAPI (Python)
  • Core Engine: Pure Python reconciliation logic (core/)
  • Database: Supabase PostgreSQL with RLS
  • Storage: Supabase Storage (CSV/XLSX files)

The architecture flows strictly as: Web → FastAPI API → Core Engine → Database

[!NOTE] The Command Line Interface (recon) is a fully featured CLI that consumes the FastAPI REST API using Personal Access Tokens (PATs).

Quick Start

1. Backend (FastAPI)

cd /home/abhishek/PROJECTS/recon-agent
.venv/bin/python -m uvicorn api.main:app --host 0.0.0.0 --port 8000 --reload

Health check: curl http://localhost:8000/health

2. Frontend (Next.js)

cd /home/abhishek/PROJECTS/recon-agent/web
npm run dev

Command Line Interface (CLI)

Recon Agent includes a powerful CLI that acts as a first-class client to the FastAPI backend. It allows you to automate reconciliations, view history, export reports, and generate AI explanations straight from the terminal.

Installation

Install locally via pip or uv:

pip install -e .
# or
uv pip install -e .

This makes the recon command globally available.

recon --help

Usage

  1. Login: Generate a Personal Access Token in the Web UI, then run:
    recon login
    
  2. Reconcile:
    recon reconcile source.csv target.csv
    
  3. History:
    recon history
    
  4. Machine Readable output:
    recon history --json
    

Documentation

Development

uv sync

Create .env (root) and web/.env.local with these values.

Root .env

SUPABASE_URL=https://<project-ref>.supabase.co
SUPABASE_SERVICE_KEY=<service_role JWT>      # NOT the publishable key!
CLERK_SECRET_KEY=sk_test_...
CLERK_ISSUER=https://<your-app>.clerk.accounts.dev
ENCRYPTION_KEY=<base64 32 bytes>

web/.env.local

NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_...

Database Setup

Run the SQL in api/migrations/001_initial_schema.sql in the Supabase SQL editor.

This creates the tables and enables RLS policies.

How multi-tenancy works

  1. User signs in with Clerk (organizations enabled)
  2. Clerk JWT is sent on every API request
  3. Backend extracts clerk_org_id from JWT
  4. Each DB query is scoped to that org — RLS enforces isolation as a backstop

See api/migrations/001_initial_schema.sql to 005_usage_quotas.sql for the full schema.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

recon_agent-0.1.5.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

recon_agent-0.1.5-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

Details for the file recon_agent-0.1.5.tar.gz.

File metadata

  • Download URL: recon_agent-0.1.5.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.20 {"installer":{"name":"uv","version":"0.11.20","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Omarchy","version":"4.0.0","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for recon_agent-0.1.5.tar.gz
Algorithm Hash digest
SHA256 a6bd78fbe96f71a2f198b7b55bb0f6068526b4d2943c4f29823c2d34938ef357
MD5 07404f5f20c78e6682a60245b309420f
BLAKE2b-256 41bf1ca226df2e8e8184dc35a96b485372426602f40a12b020d38249119df4b9

See more details on using hashes here.

File details

Details for the file recon_agent-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: recon_agent-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 14.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.20 {"installer":{"name":"uv","version":"0.11.20","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Omarchy","version":"4.0.0","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for recon_agent-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 7dca9dea68955c41c0072e80e996f8b09e3a9947092be65000c7176ee3ec081a
MD5 b02fc8e08b6ca2a007aa5d3d20a1eef8
BLAKE2b-256 e7a6f007b579b68423709590fd189fef5df427944d3e2d0fa868eae28bcc5b1f

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.6

2 files

This release

0.1.5 This release

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page