Architettura, ADR, schema DB, agenti, cron e versioning. Vista per chi opera sul codice.
Sistema multi-agente di scouting & enrichment continuo per il fondo Djungle Bridge.
Il sistema lavora su un bacino di 15.012 societΓ italiane (registro startup e PMI innovative). Un funnel deterministico seleziona ~2.300 candidate; agenti AI le arricchiscono (financials, founder, causa stallo, modello di business); un cockpit operativo permette di comporre pacchetti per stadio della pipeline e dispatchare batch ai diversi tier di analisi.
Output finale: scoring 7-dimensioni in stile Bridge (controllabilitΓ , recuperabilitΓ , prodotto, break-even, unit economics, team, exit) + matrice di sinergie + mappa acquirenti.
Tre layer disaccoppiati: dati, runtime, dashboard.
Architecture Decision Records β ogni decisione tracciabile.
| ADR | Titolo | Stato | Data |
|---|---|---|---|
| ADR-0001 | Sistema multi-agente (Supabase + Inngest + Managed Agents β Cowork) | Accepted Β· Implemented | 2026-05-15 |
| ADR-001 | Pipeline Cockpit & Batch Simulator (opzione C, fase 1) | Accepted Β· Implemented | 2026-05-31 |
| ADR-002 | C.1 Foundation: schema agent_batches + cockpit + Realtime | Accepted Β· Side A done Β· Side B in Cowork | 2026-05-31 |
| ADR-003 | Dashboard "Bacino Β· Profilo qualitativo" | Accepted Β· Implemented | 2026-05-31 |
| ADR-004 | Pacchetto Builder (anticipo C.2) | Accepted Β· Implemented | 2026-05-31 |
| ADR-006 | Founder enrichment + team-enrichment deep dive | Implemented (prompt tier1 patched Β· team-enrichment task creato) | 2026-06-01 |
| ADR-008 | Falco Β· scout conversazionale (sostituisce Builder) | Accepted Β· Implemented Β· AGT-104 sync | 2026-06-02 |
| ADR-009 | Bacino Β· Asset Queue + Conversation-first (sostituisce ADR-003) | Accepted Β· Sprint 1 Implemented | 2026-06-03 |
| ADR-010 | Investor View Β· cap-table completa + mappa investitori β aziende | Sprint 1+2+3 Implemented Β· backfill 234 inv Β· dedup via pg_trgm + UI merge Β· Sprint 1.5 patch tier1 pronto in PATCH-tier1-round-history.md | 2026-06-03 |
| ADR-011 | Exclusion Basket Β· one-shot retroattivo, no regola persistente | Sprint 1+2 Implemented Β· table + RPC bulk_exclude + reactivate + UI /basket.html Β· Sprint 1.5 patch tier2/3 pickup in PATCH-tier-exclusion-filter.md | 2026-06-03 |
| ADR-012 | Batch Reports persistiti Β· ogni tier scrive il proprio report | Sprint 1+2 Implemented Β· batch_reports + v_company_reports + v_team_activity esteso + UI /reports.html Β· Sprint 1.5 patch 7 prompt task in PATCH-tier-batch-report.md | 2026-06-03 |
In roadmap: ADR-001 fase C.3 (AI composer, trigger β₯30 pacchetti storici) Β· ADR-001 fase C.4 (predictive layer, trigger β₯30 outcome scoring).
Derivati dalla view v_pipeline_stage a partire dalla presenza di dati nel DB.
| Stage | Condizione | Pop. corrente |
|---|---|---|
| worklist | funnel_status='in_worklist' AND NOT enriched.tier1 | β |
| enriched | enriched.tier1=true Β· attributi base scritti | β |
| tier2_in_progress | almeno 1 dei 4 tier2 ha scritto (gtm_*, bp_*, team dim, acquirer_targets) | β |
| tier2_done | tutti e 4 i tier2 fatti | β |
| scored | scores.total + scoring_model_id presente | β |
| excluded | funnel_status != 'in_worklist' | β |
Cowork esegue. Ogni task fa pickup da agent_batches WHERE agent_target=<suo nome> via FOR UPDATE SKIP LOCKED e scrive sulle tabelle standard.
| Agent target | Cowork task | Tier | Scrive su | Stato |
|---|---|---|---|---|
tier1-enrichment | bridge-tier1-enrichment-batch | 1 | company_attributes_history Β· signals Β· founders Β· founder_roles Β· companies.enriched.tier1 | Live + auto-feed |
team-enrichment | bridge-team-enrichment | 1+ (deep dive) | founders (bio + linkedin) Β· founder_roles | Live Β· pickup-only |
tier2-commercial | bridge-tier2-commercial | 2 | company_attributes_history (gtm_*) | Da creare (Cowork) |
tier2-bp | bridge-tier2-bp | 2 | company_attributes_history (bp_*) | Da creare (Cowork) |
tier2-team | bridge-tier2-team | 2 | scores.dimensions.team | Da creare (Cowork) |
tier2-acquirer | bridge-tier2-acquirer | 2 | acquirers Β· acquirer_targets | Da creare (Cowork) |
tier3-scoring | bridge-tier3-scoring | 3 | scores (7 dim + total + recommendation) | Da creare (Cowork) |
tier3-synergy | bridge-tier3-synergy | 3 | synergies | Da creare (Cowork) |
falco Β· AGT-104 | edge function falco-chat β Anthropic Sonnet 4.5 Β· system prompt sync da Djungle AgentOS (AGT-104) | Scout | nessuna scrittura diretta Β· propone azioni che l'utente conferma (note, batch, direttive) | Live Β· prompt AGT-104 sincronizzato 2026-06-02 |
Tutte su dashboard.djunglebridge.com, deploy Vercel, auth Supabase magic-link.
| Pagina | Vocazione | Theme | Versione |
|---|---|---|---|
/ Β· Cockpit | Decisione operativa: stage funnel, active batches con progress, recent batches, drill-down per stage + dispatch | Dark | 1.3 |
/ Β· Dati | Lettura ranking worklist con search, dettaglio per societΓ (attributi, founder, signals, score) | Dark | 1.2 |
/ Β· Agenti at Work | Stato agent_runs aggregato + run recenti | Dark | 1.0 |
/scout.html | Sostituisce Builder Β· chat conversazionale con Falco, voice (Web Speech it-IT), pannello live cohort, batch dispatch, activity drawer team | Dark | 1.0 |
/builder.html | /scout.html (ADR-008 Β§D2) | β | 1.2 (legacy) |
/bacino.html | Riscritto Β· ADR-009 Β· Asset Queue top 20 ordinata per SPD v0.2 + KPI bar + actions (open/propose tier2/note/archive) + pointer a Scout per esplorazioni libere | Light | 2.0 |
/bacino-legacy.html | Light | 1.2 (legacy) | |
/docs.html | Questa pagina | Light | 1.0 |
Supabase project oxxxwbjocjkxcwglgpwn Β· Postgres 17 Β· region eu-west-1 Β· RLS attiva
| Tabella | Cosa contiene |
|---|---|
companies | Anagrafica startup + PMI innovative (15.012). Marker enriched.tier1 per Tier 1 done |
company_attributes_history | Storico append-only attributi arricchiti (financials, prodotto, causa stallo, ...) con confidence e fonte |
founders + founder_roles | EntitΓ founder + relazione N:M con company; ruolo, equity %, LinkedIn, bio |
signals | Evidenze grezze (news, post, comunicati) collegate a company/founder |
scoring_models + scores | Framework di scoring versionato (pesi/soglie/bonus) + score Tier 3 con 7 dimensioni |
synergies Β· acquirers Β· acquirer_targets | Matrice sinergie + buyer industriali/finanziari |
agent_runs | Log operativo di ogni sessione agente, alimenta "Agenti at Work" |
agent_batches + agent_batch_runs | Pacchetto = unitΓ decisionale del Cockpit. Status: queued/in_progress/done/failed/cancelled |
cohorts + cohort_versions | Scaffolding per cohort salvati dal Builder (selection_kind='cohort') |
cockpit_presets | 7 preset di tesi del Builder (editoriale, modificabile via SQL) |
funnel_state | Esito Funnel Tier 0 per ogni company (passed + reasons) |
company_user_notes nuovo Β· ADR-008 | Note del team sui singoli asset (contesto soft, ognuno scrive le sue, tutti leggono). 3 autori ammessi: alessandro Β· giulietta Β· davide |
agent_instructions nuovo Β· ADR-008 | Note promosse a direttive operative. Modificano sub_score di Β±15 punti max. Audit trail via source_note_id + promoted_by |
user_activity_seen nuovo | Last-seen-timestamp per ogni utente, usato dal badge "AttivitΓ team" |
v_pipeline_stage β stage derivato per ogni company dalla presenza di dativ_builder_company β dataset filtrabile (solo enriched, una passata aggregata)v_team_activity nuovo β feed unificato note + direttive + batch creati da umaniv_asset_queue nuovo Β· ADR-009 β calcolo SPD v0.2 deterministico per il bacino enriched, ordinato per prioritΓ decisionale (PASS β₯70 sweet spot)v_bacino_kpi nuovo Β· ADR-009 β 5 metriche per la KPI bar di /bacino (worklist, enriched, sweet_spot, scored, batch attivi)bacino_asset_queue(top_n, total_limit) nuovo Β· ADR-009 β RPC single-call che restituisce {kpi, top[20], next[30]} per la pagina Bacinobacino_archive_from_queue(uuid, reason) nuovo Β· ADR-009 β archivia una company dalla queue inserendo una nota negativa (SPD -200, non riappare)bacino_dashboard() β RPC che restituisce in un solo jsonb le 16 sezioni del Bacinoactive_batches_with_progress() β RPC con progress_done calcolato dalle scritture realicleanup_orphan_batches() β chiude batch orfani >2h, deduplica auto-feed (chiamata da pg_cron)funnel_tier0(criteria jsonb) β Funnel deterministico, valutato dall'edge functionfalco_context_bundle(notes_limit) nuovo β KPI + 7 preset + ultime 50 note + direttive attive in un solo jsonb (iniettato nel system prompt di Falco)falco_filter_preview(spec) nuovo β applica uno spec di filtri sul bacino enriched e ritorna {count, sample 50, mix_banda, mix_settore, mix_provincia}falco_create_batch Β· falco_add_note Β· falco_promote_note Β· falco_deactivate_directive nuove β wrapper di scrittura con audit trail automatico (creator/promoter mappato da auth.uid)unseen_activity_count() Β· mark_activity_seen() nuove β RPC per il badge "AttivitΓ team"is_bridge_user(uid) Β· bridge_user_label(uid) nuove β helper RLS, mappa UID β label per i 3 founder autorizzatiJob schedulati direttamente in Postgres.
| Componente | Provider | Note |
|---|---|---|
| System of record | Supabase (Postgres 17) | Project bridge-portfolio, region eu-west-1 |
| Dashboard hosting | Vercel | Project bridge-portfolio-dashboard Β· custom domain |
| Runtime agenti | Cowork (claude.ai) | Scheduled tasks pickup-by-batch (ADR-002 Β§4) |
| Auth dashboard | Supabase Auth + Resend SMTP | Magic link via noreply@djunglebridge.com |
| Real-time UI | Supabase Realtime | Channel su agent_batches |
| Seed dati | Registro Imprese italiano | Sezioni "Startup innovative" (11.806) + "PMI innovative" (3.206) |
| Versione | Data | Highlights |
|---|---|---|
| 1.3.0 | 2026-06-03 | ADR-010 v2 Investor View Β· 2 tabelle nuove (investors, investor_companies) con 8 ruoli (lead/co_invest/follower/angel/public/secondary_buyer/grant_provider/unknown) Β· helper _split_investor_names + trigger fn_populate_investors_from_round su company_attributes_history Β· backfill one-shot 136 round_ultimo β 227 investors / 249 partecipazioni Β· vista v_investor_summary + RPC investitori_kpi / investor_detail Β· pagina /investitori.html con KPI bar, distribuzioni ruoli/tipi, tabella sortable + drill-down inline + chat pointer Falco Β· nav esteso |
| 1.2.0 | 2026-06-03 | ADR-009 Bacino Asset Queue Β· pagina /bacino.html riscritta (vecchia versione preservata in bacino-legacy.html) Β· SPD v0.2 deterministico in v_asset_queue Β· v_bacino_kpi + RPC bacino_asset_queue/bacino_archive_from_queue Β· cards top 20 con razionale Falco (auto-fallback) + actions (open/propose tier2/note/archive) Β· scout supporta ?prefill= |
| 1.1.0 | 2026-06-02 | ADR-008 Falco Β· edge function falco-chat live (Anthropic Sonnet 4.5) Β· pagina /scout.html con voice it-IT Β· 5 RPC Falco + helper RLS Β· v_team_activity + badge AttivitΓ Β· 2 tabelle nuove (company_user_notes, agent_instructions) Β· Builder deprecato (redirect) |
| 1.0.0 | 2026-06-01 | Doc consolidata + Bacino con drill-down tag mercati + nomi descrittivi (no piΓΉ lettere) + team-enrichment in dropdown |
| 0.9.0 | 2026-06-01 | Cleanup orfani via pg_cron + dedup auto-feed duplicati Cowork Β· view Builder ottimizzata 1.300Γ |
| 0.8.0 | 2026-05-31 | ADR-004 Builder live Β· 7 preset di tesi Β· cohort scaffolding Β· ADR-003 Bacino live (16 sezioni RPC) |
| 0.7.0 | 2026-05-31 | ADR-002 C.1 schema deployato Β· view v_pipeline_stage Β· Realtime su agent_batches |
| 0.6.0 | 2026-05-20 | Cockpit MVP Β· dispatch manuale agent_batches Β· stage cards Β· drill-down |
| 0.5.0 | 2026-05-20 | Detail view su singola societΓ Β· search box Β· agent prompts v2 anti-contaminazione |
| 0.4.0 | 2026-05-19 | Dashboard live su dashboard.djunglebridge.com Β· magic link Resend Β· 3 utenti |
| 0.3.0 | 2026-05-17 | Provisioning 8 Managed Agents + vault MCP Β· primo test end-to-end (3 societΓ enriched) |
| 0.2.0 | 2026-05-17 | Orchestrator Inngest + dashboard scaffold Β· auth gate Β· RLS attiva |
| 0.1.0 | 2026-05-15 | Schema iniziale (12 tabelle) Β· ETL 11.806 startup Β· Funnel Tier 0 Β· scoring model v1 |
Generato live Β· sorgenti: Supabase bridge-portfolio Β· vista compagna: Bacino