Governed AI Execution for Delegated Business Responsibilities
OWNARA is an AI-powered business operations system designed around a simple idea:
Instead of asking AI to perform isolated tasks, give an AI operator a persistent business responsibility — with clear authority boundaries, human approval, and an auditable execution trail.
The system represents responsibilities as Mandates. Each Mandate defines what an AI operator is responsible for, what actions it is allowed to take, when human approval is required, and how every decision is recorded.
The current implementation focuses on Kavya, an AI Accounts Receivable operator for B2B businesses.
Kavya is responsible for maintaining healthy receivables.
The system continuously evaluates receivables data, identifies collection risks, proposes actions, waits for human approval when an action is consequential, executes the approved action, and records the complete execution history.
┌──────────────┐
│ OBSERVE │
│ Receivables │
│ State & Risk │
└──────┬───────┘
│
▼
┌──────────────┐
│ REASON │
│ Strategy & │
│ Reminders │
└──────┬───────┘
│
▼
┌──────────────┐
│ APPROVE │
│ Human Review │
│ Gate │
└──────┬───────┘
│
▼
┌──────────────┐
│ EXECUTE │
│ Approved │
│ Actions │
└──────┬───────┘
│
▼
┌──────────────┐
│ AUDIT │
│ Hash-Chained │
│ Ledger │
└──────────────┘
The operator evaluates:
- Accounts receivable state
- Invoice aging buckets
- Customer credit profiles
- Previous payment-response history
- Outstanding and overdue invoices
The system determines an appropriate recovery strategy, such as:
- Prioritizing high-value overdue accounts
- Investigating disputed invoices
- Escalating unresponsive customers
- Drafting targeted payment reminders
Consequential actions do not execute immediately.
OWNARA generates a canonical Execution Contract containing the proposed action and its authority context.
The contract is cryptographically hashed and presented to a human reviewer before execution.
Once approved, the action is executed through the configured communication layer.
The current implementation uses transactional SMTP email.
Every important decision and execution event is recorded in a tamper-evident audit ledger using:
- Monotonic sequence numbers
- SHA-256 hash chaining
- PostgreSQL transaction controls
- Execution contracts
- Operator performance metrics
Kavya is the first specialized AI operator implemented inside OWNARA.
Her current Mandate is:
Maintain Healthy Receivables
The system evaluates the persistent objective:
overdueRate <= 0.15
and selects appropriate strategies based on the current receivables state.
Persistent business objectives are represented as Mandates rather than isolated prompts.
The Mandate Supervisor continuously evaluates whether the objective is being satisfied and determines when another execution cycle is required.
Before consequential actions are executed, the proposed action can be reviewed by a human.
The interface provides:
- Proposed action
- Authority context
- Execution Contract
- Action diff
- Approval
- Rejection
OWNARA records the execution history using a hash-chained ledger.
Each event contains deterministic sequencing and cryptographic linkage to previous events, making unauthorized modification easier to detect.
The backend supports provider adapters for:
- Google Gemini
- OpenAI
- Anthropic
- Ollama (local open-weight models)
Requests fail over automatically in the order Gemini → OpenAI → Anthropic → Ollama. When no provider API key is configured, the gateway falls back to a deterministic mock provider.
The default configuration uses Google Gemini.
The project includes automated evaluation capabilities for measuring operator behavior across predefined Mandate scenarios.
Evaluation includes:
- Task outcomes
- Authority compliance
- Decision quality
- Execution behavior
- Operator skill progression
Customer and invoice information can be imported through CSV files with validation for fields such as:
- GSTIN
- Payment terms
- Customer information
- Invoice information
OWNARA currently runs as a two-service application backed by PostgreSQL.
┌─────────────────────────┐
│ Web Service │
│ │
│ Next.js 16 + React 19 │
│ UI + API Routes │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ Mandate Engine │
│ │
│ Supervisor / Authority │
│ Decision / Execution │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ Worker Service │
│ │
│ Background Runtime │
│ Task Execution │
│ Audit Processing │
└────────────┬────────────┘
│
┌────────────┴────────────┐
▼ ▼
┌──────────────┐ ┌──────────────┐
│ PostgreSQL │ │ LLM Gateway │
│ │ │ Gemini / │
│ State / Audit│ │ OpenAI / │
│ / Mandates │ │ Anthropic │
└──────────────┘ └──────────────┘
| Layer | Technology |
|---|---|
| Frontend | Next.js 16, React 19 |
| Backend | Next.js API Routes / Node.js |
| Database | PostgreSQL |
| ORM | Prisma |
| AI | Gemini / OpenAI / Anthropic / Ollama adapters (+ deterministic mock fallback) |
| Background Runtime | Node.js / TypeScript |
| SMTP | |
| Authentication | JWT |
| Evaluation | Deterministic scenario-based evaluation |
| Deployment | Railway / Docker |
OWNARA is intentionally designed around authority, not just intelligence.
An AI operator should not automatically have unlimited permission to act.
The execution model therefore separates:
Intent
↓
Authority
↓
Decision
↓
Approval
↓
Execution
↓
Audit
This creates a boundary between:
- What the business wants
- What the AI recommends
- What the AI is authorized to do
- What requires human approval
- What was actually executed
- What happened afterward
This governance layer is the core architectural idea behind OWNARA.
OWNARA is currently a portfolio and engineering prototype, not a production accounting or collections platform.
The repository intentionally does not claim real enterprise customers, real financial outcomes, or production-scale performance.
- Kavya AI Accounts Receivable operator
- Mandate engine
- Mandate supervisor
- Human approval workflow
- Execution Contracts
- Hash-chained audit ledger
- PostgreSQL persistence
- Deterministic evaluation engine
- Multi-provider LLM gateway
- CSV customer/invoice ingestion
- Transactional email execution
- JWT authentication
- Background worker runtime
There is currently no active two-way integration with:
- Tally
- Zoho Books
- QuickBooks
- Stripe
Invoice and customer data is currently imported through CSV.
Document upload metadata exists, but the project does not currently implement a production vector-search/RAG pipeline.
Communication currently uses transactional email.
WhatsApp and voice-based collections are outside the current implementation.
Kavya is currently the primary active operator.
General Sales, HR, Operations, and other AI employees are not yet implemented as separate production operators.
- Node.js 22+
- npm
- PostgreSQL 16+
- Gemini API key
npm install --legacy-peer-depscp .env.example .envExample:
DATABASE_URL="postgresql://user:password@localhost:5432/ownara?schema=public"
JWT_SECRET="replace-with-a-random-secret-at-least-32-chars-long"
LLM_PROVIDER="gemini"
LLM_MODEL="gemini-3.6-flash"
GEMINI_API_KEY="your-gemini-api-key"
NODE_ENV="development"# Apply tracked migrations (recommended for production parity):
npx prisma migrate deploy
# Quick-start alternative for local development (no migration history):
# npx prisma db push --accept-data-lossnpx tsx scripts/seed.tsnpm run devOpen:
http://localhost:3000
In a second terminal:
npm run worker| Command | Purpose |
|---|---|
npm run dev |
Start Next.js development server |
npm run worker |
Start background execution worker |
npm run build |
Build the production application |
npm run start |
Start the standalone production server |
npm run lint |
Run ESLint |
npm run test |
Run core MVP acceptance tests (requires a seeded database) |
npm run test:all |
Run the full CI suite (the 7 suites below marked with ✓) |
npm run test:client |
✓ Run API client safety tests |
npm run test:rbac |
✓ Run approval RBAC tests |
npm run test:csv |
✓ Run CSV date-parsing tests |
npm run test:worker |
✓ Run worker idempotency tests |
npm run test:evaluation |
✓ Run Mandate evaluation scenarios (20 business scenarios) |
npm run test:authority |
✓ Run authority and permission boundary tests |
npm run test:escalation |
✓ Run authority escalation regression tests |
npm run test:customer |
Run the new-customer onboarding flow test (against a running app) |
npm run test:pilot |
Run design-partner readiness checks (against a running app) |
npm run test:staging |
Run controlled staging verification |
npm run db:deploy |
Apply tracked Prisma migrations |
npm run db:migrate |
Create and apply a development migration |
npm run db:push |
Push Prisma schema directly (dev only) |
npm run db:generate |
Regenerate Prisma Client |
npm run db:reset |
Reset the database and re-apply migrations (dev only) |
| Variable | Required | Description |
|---|---|---|
DATABASE_URL |
Yes | PostgreSQL connection string |
JWT_SECRET |
Yes | JWT signing secret |
LLM_PROVIDER |
Yes | Primary LLM provider |
LLM_MODEL |
No | Selected model |
GEMINI_API_KEY |
Yes* | Gemini server-side API key |
SMTP_HOST |
No | SMTP relay host |
SMTP_PORT |
No | SMTP relay port |
SMTP_USER |
No | SMTP authentication username |
SMTP_PASS |
No | SMTP authentication credential |
SMTP_FROM |
No | Outbound sender address |
SMTP_FROM_NAME |
No | Sender display name |
CORS_ALLOWED_ORIGINS |
No | Allowed application origins |
NODE_ENV |
Yes | Runtime environment |
- Required when Gemini is configured as the active provider.
OWNARA is containerized and can be deployed as separate web and worker services.
The repository includes Railway deployment documentation:
The production topology consists of:
Web Service
│
├── Next.js application
├── API routes
└── Decision Center
Worker Service
│
├── Mandate Supervisor
├── Task execution
└── Background processing
│
▼
PostgreSQL
Most AI applications focus on:
"Can the model perform the task?"
OWNARA focuses on a different question:
"Can an AI system be trusted with a persistent business responsibility?"
That requires more than a capable model.
It requires:
Authority → Governance → Approval → Execution → Audit
OWNARA explores that architecture through a concrete business workflow: accounts receivable operations.
Status: Active Portfolio Prototype
The current implementation demonstrates the architecture and engineering patterns required for governed AI execution.
The project is intentionally evolving toward a broader AI Employee / Business Operations platform while keeping authority boundaries and auditability as first-class system primitives.
Proprietary and Confidential.
Copyright © 2026 OWNARA. All rights reserved.