Inspiration

The informal economy in Mexico operates on cash, trust, and handwritten paper notebooks (libretas de fiados). Standard B2B SaaS platforms are structurally useless for this demographic—they assume high digital literacy, structured accounting knowledge, and desktop workflows.

Cru was engineered specifically to empower female micro-business owners, backed by the non-profit organization Impeler, Apoyo Social, A.C. To eliminate the software learning curve entirely, Cru removes the traditional software interface. The entire system operates voice-first in Mexican Spanish over Telegram, providing entrepreneurs with an autonomous back-office without requiring them to learn, install, or navigate complex business software.

What it does

Cru is an autonomous multi-agent architecture that processes chaotic, informal audio dictation—including heavy Mexican slang, Spanglish, and background noise—and converts it into structured business operations:

  • Voice-Native Bookkeeping: Micro-entrepreneurs record sales, debts (fiados), and partial payments (abonos). Cru isolates client names and numerical values, enforcing a visual confirmation loop ([ ✅ Guardar ] / [ ❌ Me equivoqué ]) before committing transactions to PostgreSQL.
  • Instant Invoicing & Quotes: Converts messy verbal job descriptions into formal, itemized PDF quotes and invoices delivered directly into the Telegram chat within seconds.
  • Conversational Form Engine (Trámites): Guides beneficiaries step-by-step through complex micro-loan applications and business diagnostic questionnaires, saving Impeler staff hundreds of hours of manual intake.
  • Grounded Legal & Tax Mentorship: Answers regulatory and tax questions (such as SAT RESICO, RFC, and IMSS guidelines) without hallucinations by querying a verified local knowledge base.
  • Dual-Portal Web Platform: Beneficiaries access a mobile-first portal via passwordless magic links to review accounts, track expenses, and monitor net profits, while Impeler coordinators use a succinct Admin Workstation for complete portfolio oversight, credit management, and compliance auditing.

How we built it

The platform is engineered for high concurrency, sub-second latency, and minimal operational overhead:

  • Core Engine: Written in Go and compiled into a single high-performance binary deployed as a minimal container on Google Cloud Run (cpu_idle = false).
  • AI & Agent Swarm: Powered by Google's Gemini 3.7 Flash using the modern unified Google GenAI SDK (google.golang.org/genai) for multimodal audio ingestion, real-time intent routing, and autonomous function calling.
  • Data Layer & Vector RAG: Backed by PostgreSQL 18 with connection pool tuning and a zero-dependency custom PL/pgSQL dot_product vector similarity function over 768-dimensional embeddings (gemini-embedding-001).
  • Telegram Integration: Built on a webhook pipeline with in-memory message debouncing and application lifecycle context decoupling.
  • Auditing & Telemetry: Complies with XPRIZE tracking requirements via structured JSON logging in LogToolExecution(), capturing every autonomous tool invocation and token usage metric (xprize_tracking: true).
  • Open Source Governance: Licensed as Free Software under the GNU GPLv3 and built under our Universal Code of Honor.

Challenges we ran into

  1. Disambiguating Informal Financial Language: Informal Spanish mixes intents and colloquial verbs rapidly (e.g., distinguishing a debt update "Don Chuy me debía 500 pero hoy me abonó 200" from a new charge). Calibrating the router and function-calling schemas to reject background noise while extracting precise entities required rigorous prompt tuning and strict validation logic.
  2. Serverless Concurrency & Context Decoupling: In a serverless environment like Cloud Run, returning an instant 200 OK to Telegram could cause the hypervisor to throttle CPU before background audio downloads, TTS synthesis, or database writes finished. We resolved this by decoupling transient HTTP contexts via context.WithoutCancel, configuring continuous CPU allocation, and implementing database advisory locks for background workers.
  3. Conversational Questionnaire Lifecycle: Designing a dynamic questionnaire engine that handles schema evolution was complex. If an admin updates a template by adding a new question, Cru uses delta questioning to identify only the missing answers and prompt the user for the delta, rather than forcing them to restart the form.
  4. Zero-Dependency Vector Retrieval: Avoiding foreign vector database lock-in by executing normalized cosine similarity math directly within PostgreSQL using native array operations.

Accomplishments that we're proud of

  • Zero-Friction Adoption: Beneficiaries with minimal digital literacy are successfully tracking receivables, recording expenses, and generating formal PDF quotes within minutes of their first voice note.
  • Production-Grade Resilience: Achieved clean test execution across unit, database mock, and headless browser automation suites (chromedp), alongside a 100% pass rate across all 21 automated multi-agent conversational scenarios.
  • Institutional Value for Impeler, Apoyo Social, A.C.: Deployed a functional dual-portal system providing coordinators with complete portfolio visibility, RAG knowledge curation, and an immutable audit trail.
  • Extremely Lean Unit Economics: Engineered an architecture capable of running multi-turn agent workflows at token costs measured in fractions of a cent per interaction.

What we learned

  • The Interface is the Bottleneck: In low-income and informal markets, the barrier to technology adoption is not a lack of utility, but interface friction. When you remove login screens, forms, and apps, and meet users in their native messaging app via voice, adoption resistance disappears.
  • Deterministic Guardrails on Probabilistic AI: Binding LLMs to real financial ledgers requires strict typing, function calling, and explicit confirmation loops. The AI should handle interpretation, but the database state machine must remain deterministic.
  • RAG Over Fine-Tuning for Regulations: Localized, domain-specific retrieval-augmented generation provides verifiable, auditable legal answers that can be updated immediately by coordinators without model retraining.

What's next for Cru

  • Expanded Field Rollout: Scaling adoption across the entire Impeler, Apoyo Social, A.C. beneficiary network and partner regional community programs in Mexico.
  • Automated Supply & Price Optimization: Expanding Cru's toolset to cross-reference local wholesale market prices, protecting profit margins for food vendors and artisans.
  • Repayment Tracking & Alternative Credit Scoring: Utilizing verified transaction and ledger histories to help informal entrepreneurs build alternative credit profiles and unlock formal micro-financing.

Built With

Share this project:

Updates