About FounderFly

FounderFly documentation

This document explains the full FounderFly system: how workspaces are created, how structured memory is stored, how HydraDB retrieval works, how OpenAI produces briefs and answers, and how the application is isolated by organization in production.

Overview

What FounderFly is doing under the hood

FounderFly is not a single generic chatbot attached to company data. It is a workspace-native system that treats each strategic thread as its own operating surface. Investor prep, customer renewals, board planning, and hiring loops all live in separate workspaces so the application can preserve context without mixing distinct jobs together.

At runtime, FounderFly combines four kinds of state: product state in Postgres, retrieval memory in HydraDB, identity and organization ownership in Clerk, and final synthesis through OpenAI. That separation is deliberate. It keeps the product reliable, explainable, and multi-tenant.

Architecture

System architecture

01

User interaction layer

The founder or teammate works inside a single workspace. Every investor process, customer renewal, board prep cycle, and hiring loop is intentionally isolated so context does not bleed across threads.

  • Workspace list is organization-scoped
  • Each workspace keeps its own memory history
  • Each workspace keeps its own conversation thread
02

Application orchestration layer

Next.js App Router handles both the interface and the server-side orchestration. Route handlers enforce organization context, persist product state, retrieve memory evidence, and coordinate final response generation.

  • Server routes power ingest, brief, ask, and workspace hydration
  • Clerk auth is enforced before org-scoped data access
  • UI and backend live in one deployable application
03

Operational persistence layer

Neon Postgres is the source of truth for product state. This includes workspaces, memories, archived workspaces, conversations, and messages. Prisma defines and accesses that relational model.

  • Durable state survives reloads and sessions
  • Queries are scoped by Clerk organization
  • Workspace entities remain explicit and queryable
04

Memory retrieval layer

HydraDB acts as the recall engine. FounderFly syncs structured workspace memory into HydraDB and retrieves relevant evidence for the active workspace when preparing a brief or answering a question.

  • Tenant id is derived from organization id
  • Evidence retrieval is filtered back to the current workspace
  • Returned evidence is surfaced in the UI as source cards
05

Reasoning and synthesis layer

OpenAI synthesizes the retrieved context into the final founder-facing brief and answer. The prompts are tuned to summarize, prioritize, and coach rather than merely restating raw notes.

  • Brief output is structured into three sections
  • Answer output includes response plus next-step coaching
  • Fallback logic exists when model or recall quality is thin

Workspace lifecycle

How a workspace becomes useful over time

Workspace creation

An admin creates a workspace with a name, type, focus, and suggested opening question. This creates the operating container that future memories and questions belong to.

Memory accumulation

Team members add investor objections, customer insights, internal decisions, and roadmap updates. FounderFly stores them as structured memory, not just loose text blobs.

Conversation continuity

Every question asked inside the workspace is added to a persistent conversation thread. That means the next brief can take recent Q&A context into account.

Brief preparation

When the founder clicks Generate brief, FounderFly loads saved context, retrieves external evidence, and prepares a concise workspace-specific briefing surface.

Answer generation

When the founder asks a hard question, FounderFly answers from the active workspace context instead of from generic global memory.

Ingestion pipeline

How memory moves from the UI into retrieval

FounderFly’s ingestion path is intentionally layered. It never depends on HydraDB alone. The application first persists the memory as durable product state, then attempts to sync it into the retrieval layer so future briefs and answers can show evidence cards.

1

Typed memory input

The ingestion form is structured by memory type so investor pushback, customer feedback, internal decisions, and roadmap changes can be captured with clearer prompts.

2

Postgres write

The application writes the memory to the workspace in Postgres first so the product state remains durable even if HydraDB is temporarily unavailable.

3

HydraDB sync

FounderFly attempts to create or verify the organization tenant in HydraDB, uploads the memory, and stores the returned Hydra source id back into Postgres when available.

4

Evidence feedback

After ingest, the UI updates memory history immediately and tries to refresh source evidence so the user can see what the system just absorbed.

Brief generation

How FounderFly builds the workspace brief

The brief path is not a static template. FounderFly combines stored workspace memory, recent conversation turns, and HydraDB evidence, then asks OpenAI to synthesize a short document shaped around three jobs: what matters now, what to be ready for, and what to do next.

Load the active workspace and validate the user belongs to an active Clerk organization.
Read recent workspace memories and recent conversation turns from Postgres.
Retrieve evidence from HydraDB for the same workspace and same organization tenant.
Merge saved memory evidence with recalled Hydra evidence.
Send the combined context to OpenAI with a structured brief prompt.
Render the brief as What matters now, What to be ready for, and What to do next.

Answer generation

How FounderFly answers a founder question

Answer generation follows a similar path to brief generation, but it is optimized for a narrower task: take one strategic question, retrieve the best relevant evidence, answer concisely, and suggest the next best action.

Accept a founder question together with the active workspace id.
Retrieve the active workspace context from Postgres.
Ask HydraDB for relevant evidence tied to the workspace and tenant.
Generate a concise answer and one best next step through OpenAI.
Persist the new user turn and agent turn into the workspace conversation thread.
Show the answer and source evidence together so the reasoning path is visible.

API routes

Backend endpoints and their responsibility

Route
Purpose
GET /api/workspaces
Hydrates the active Clerk organization with active workspaces, archived workspaces, memory history, and conversation state.
POST /api/workspaces
Creates a new organization-scoped workspace for investor, customer, or hiring use cases.
GET /api/workspaces/[workspaceId]
Returns one workspace together with its memories and latest conversation thread.
POST /api/ingest
Writes structured memory into Postgres and attempts HydraDB sync for the same organization tenant.
GET /api/brief?workspaceId=:id
Builds the workspace brief from saved memory, recent conversation, and retrieved Hydra evidence.
POST /api/ask
Answers a founder question, stores the new conversation turn, and returns evidence-backed output.

Data model

Operational entities stored in Postgres

Workspace

The top-level operating container. A workspace is a single strategic thread such as a fundraise, renewal, board cycle, or hiring loop.

organizationIdslugnamekindfocussuggestedQuestionarchivedAt

Memory

A structured workspace memory entry. It stores what happened, why it matters, and optionally which Hydra source id corresponds to the synced retrieval memory.

typetitledetailimpactoriginhydraSourceIdcreatedAt

Conversation

A persistent thread attached to one workspace. This is how FounderFly remembers what has already been asked and answered in that operating context.

workspaceIdorganizationIdtitleupdatedAt

Message

An individual user or agent turn. Messages are ordered by creation time and surfaced in the conversation memory panel.

conversationIdroletextcreatedAt

Multi-tenancy

How FounderFly isolates one company from another

Authentication boundary

Clerk identifies the signed-in user and active organization. Without an active organization, FounderFly does not allow workspace access.

Database boundary

Every workspace, memory, and conversation query is scoped by organization id so one company never reads another company’s product state.

Hydra boundary

Hydra tenant ids are derived from Clerk organization ids. That keeps retrieval memory separated by company as well as by workspace.

UI boundary

Workspace selection, memory history, conversation thread, and source evidence are all rendered from the currently active workspace only.

Deployment

Production deployment model

Layer
Service
Frontend + backend routes
Vercel
Application database
Neon Postgres
ORM and schema management
Prisma
Authentication and organization ownership
Clerk
Memory retrieval engine
HydraDB
Reasoning and synthesis
OpenAI

FounderFly runs as a full-stack Next.js application on Vercel. The UI and backend routes deploy together, while Neon stores the application database, Clerk owns identity and organizations, HydraDB powers memory retrieval, and OpenAI powers the final synthesis layer.