Josué Barros backend & AI Open for contract
Portfolio / 2026 / Brazil · UTC−3 / —

AI features that survive contact with real users.

I build the unglamorous machinery behind AI products: retrieval that cites or refuses, tools whose arguments are validated, webhooks that retry, tenants that cannot see each other, and numbers that reconcile. Seven working systems below — public code, automated checks, fictional data.

07Systems,
running
60+Automated
checks
0Metrics I
invented
Focus · AI backends, integrations, reliability Rate · US$ 95/hour, remote Deploys · Docker, Postgres, Caddy, HTTPS
01 — The index

Seven systems, opened up.

Every entry is a personal demo with fictional data. Open a row for the hard part, the proof, the limits and the links. Nothing here is a client engagement.

A support agent that answers only from its tenant's knowledge base, shows the document and excerpt it used, and says “I could not find this” when the evidence is missing. It opens one fictional ticket through a validated tool, with every call and result written to an audit log.

  • 16 tests plus a 13-case behaviour eval: citations, abstention, tenant isolation, tool validation.
  • The tool rejects unknown arguments; the transcript records input, output and actor.
  • React/TypeScript front end, FastAPI, Postgres + pgvector, Docker and TLS in production.

LimitsHash-based embeddings unless an API key is configured; retrieval is deterministic by design, not a semantic model benchmark.

Northstar answering a question with a cited source document and excerpt
Answer with source: document, excerpt and a readable audit trail.

A signed webhook triggers a three-step order flow. The event is persisted before processing, duplicate deliveries are deduplicated, transient failures retry with backoff and jitter, and permanent failures land in a dead-letter state with a controlled replay.

  • Eight scenarios verified end to end: duplicate, timeout, tampered signature, stale request and replay after fix.
  • At-least-once delivery with idempotency keys; the notification step is deliberately not idempotent so the duplicate is visible.
  • Every execution shows each step, attempt, duration and final effect.

LimitsThis is at-least-once, not exactly-once. The demo documents where a duplicate can still reach a non-idempotent destination.

Hookline execution list with dead and succeeded runs
Dead and succeeded executions, with attempts and replay.

A field service workflow for a fictional company. A technician records a job with line items, submits it, a reviewer approves, and the app issues a demo invoice as a real PDF. Money is integer cents; invalid transitions are rejected; numbering is transactional per organization.

  • Each invoice stores a frozen snapshot, so editing a client later never rewrites an issued document.
  • 10 tests cover authorization, invalid transitions, duplicate and concurrent issuance, and a real PDF.
  • The generated invoice is downloadable and re-checkable; it is not a screenshot.

LimitsNo tax engine and no e-invoicing integration. The point is the state machine, numbering and immutability.

Ticketline ticket in the invoiced state
Approved job → issued invoice, with the snapshot frozen at issue time.

An incremental order pipeline that receives imperfect files, quarantines invalid rows with a reason, transforms the valid ones and feeds a dashboard that reconciles. Re-running the same file is a no-op; late corrections are applied only when their timestamp is newer.

  • Files are stored append-only with their hash; a watermark and run log record what happened.
  • 13/13 dbt models and tests pass: uniqueness, nullability, accepted values and a business rule.
  • Four quarantine reasons are visible in the UI; the revenue metric equals the sum of paid orders.

LimitsDuckDB and a single-node scheduler. The patterns port to warehouse-scale tools; this demo does not claim that scale.

Riverbend dashboard with valid and quarantined rows
Revenue, quarantine reasons and row counts on one page.

A reproducible migration lab for a small legacy app and its Postgres database: seed, freeze writes, consistent backup, restore into a target, versioned migration, integrity validation, cutover, a rejected write during the freeze, and a rollback proved by a successful write after.

  • 21 timed steps, all passing, with checksums, row counts, null checks and index presence.
  • The write-freeze strategy is explicit: writes fail and are recorded; the recovery point is the snapshot.
  • The public run report is the artifact — timings included, not a diagram of an intention.

LimitsDocker Compose, not a managed cluster. No zero-downtime or zero-loss claim; the freeze window is the trade-off.

Harborlift migration run report with timed steps
The run report: every step, timing and validation result.

Two fictional organizations share one Postgres database. Isolation is enforced by row-level security with FORCE RLS, not by application filters. The tenant comes from a validated session; a browser parameter cannot change it. Files download through expiring signed URLs.

  • The application role is not the table owner, so the policy cannot be bypassed by the app.
  • Audit rows are insert-only for the app role: no update, no delete.
  • 10 tests cover cross-tenant reads, connection reuse, expiry, revocation and tampering.

LimitsSingle database, not a compliance certification. Sessions and keys are demo-grade, and the threat model is written down.

Vaultgate blocking cross-tenant access
A cross-tenant request blocked by the database, not by a front-end guard.

An installable WooCommerce plugin that imports and updates a fictional catalog from an external API. It maps fields, paginates, upserts by a stable external id, logs every run and recovers from failures — through a manual sync, an hourly WP-Cron event or an HMAC-authenticated webhook.

  • Manual sync uses a nonce and capability check; a transient lock blocks concurrent runs.
  • Invalid payloads are reported per item instead of aborting the batch; the token is masked in the UI.
  • 11 end-to-end checks cover mapping, pagination, upsert, lock and recovery.

LimitsRuns in a local WordPress lab, so there is no public admin. The video and the package show the full flow.

WooBridge synced products in the WordPress admin
Synced products with the run log, token masked and errors per item.
02 — Approach

Four rules I do not trade away.

The demo is the easy part. These are the decisions that keep an AI feature from becoming an incident, a surprise invoice, or a support ticket nobody can explain.

01

Correctness you can show

Every system ships with checks a buyer can run: a behaviour eval for the agent, concurrency tests for invoices, cross-tenant tests for RLS, a rollback drill for migrations. “It works on my machine” is not evidence.

02

Permissions in code, not in the prompt

The model proposes language; the application decides what it is allowed to do. Tenant filters live in SQL, tool arguments are validated, secrets are redacted, and actions are audited.

03

Cost is a design constraint

Retrieval, caching, model choice and context size are engineering decisions. I measure tokens and latency before adding another model call, and I write down the trade-off.

04

Honest limits

At-least-once instead of exactly-once. A freeze window instead of zero downtime. Deterministic retrieval instead of magic. If I cannot prove a claim, it does not go on the page.

The tenant filter is a database fact.

In Vaultgate, the application connects as a role that does not own the tables. The policy is forced, and the tenant id comes from the session — never from a query parameter.

A front-end guard can be bypassed by a request. A policy in Postgres cannot. The demo blocks a cross-tenant read and shows the database error, not a friendly toast.

vaultgate / policies.sqlPostgres 16
-- the app role can read only its tenant's rows
alter table documents enable row level security;
alter table documents force row level security;

create policy tenant_isolation on documents
  using (tenant_id = current_setting('app.tenant_id')::uuid)
  with check (tenant_id = current_setting('app.tenant_id')::uuid);

-- sessions set it once; a request cannot override it
set local app.tenant_id = '…';
03 — Engagements

Small, paid first steps.

I prefer a scoped first stage over a long discovery call. You get a written scope, one review round and an acceptance test before the bigger commitment.

A — Diagnose

Reliability audit

One week on an existing integration or AI feature. I read the code, reproduce the failure and hand back a ranked list of fixes with evidence.

  • Failure reproduction, not a slide deck
  • Prioritised fixes with risk and effort
  • Optional pairing session to hand it over
B — Build

Integration sprint

Two to three weeks to ship one vertical slice: a RAG endpoint with citations, a durable webhook flow, a migration with rollback, or a tenant-safe API.

  • Written scope and acceptance test
  • Tests, deploy and runbook included
  • Your repository, your infrastructure
C — Sustain

Monthly capacity

A fixed block of senior engineering hours for teams that already have a roadmap and need someone who can own the backend and AI edge.

  • 40 or 80 hours per month
  • Overlap with US mornings and EU afternoons
  • Weekly written update, no status theatre

Not sure which one fits? Send the failure, the stack and the deadline. I will reply with a scope or say clearly that it is not my work.

Start with a scope →
04 — Writing

Notes from the work.

Longer pieces live on my site. No growth-hacking threads, no listicles — just what changed after a build.

05 — Contact

Tell me what keeps breaking.

A short note is enough: the system, the symptom, the stack and the deadline. I answer personally, usually within one business day, and I will tell you if the job is outside what I can prove. Based in Brazil, working on US and EU hours.

Upwork↗ LinkedIn↗ GitHub↗