// A FRAMEWORK FOR BUILDING AI FEATURES IN SAAS APPLICATIONS

A Framework for Building AI Features in SaaS Applications

Apr 10, 2025 · Phil Borel · 9 min read

Note: this is an old post, ported from my old blog. I originally wrote it for a talk I gave on April 10, 2025. AI moves fast, so read it as a snapshot of how I was thinking about AI features at the time. A few months later I wrote about building one of these features for real in RosieBot: MCP in action at RIVET.


Introduction

Who is Phil & why does he care about AI?

  1. I'm an Engineering Manager at RIVET. Previously I held titles such as "Software Engineer", "Lead Engineer" & "Founding Engineer" at Quicken Loans (pre-IPO), StockX (Seed & Series A), Procore (pre-IPO) & Portex (Pre-seed & Seed).
  2. I specialize in 0-to-1 & 1-to-n product development, with skills in Engineering, Product Management & team building.
  3. I've used a myriad of AI systems & built exactly 1 AI-enabled feature. I'm trying to learn more about this to build more AI features. I am an expert in product development, but by no means an expert in AI.
  4. My interest in AI is centered around:
    • Me: How can I use this to make my life/job easier? (vibe coding, copilots, image generation, trip itinerary planning)
    • Users: How can I use this to build useful features into my products?

What is AI?

  • A computer program that uses an LLM to reason (make decisions)
  • Some of these programs are advanced enough to act out a subset of the decisions that they make ("agentic")
  • The LLM is the result of an ML process

What is the scale of AI?

  1. There are 2 phases: the short tail (now - ? months) & the long tail (? months - years in the future)
  2. AI is a revolution (think agricultural, trades, industrial, computer, internet, smart phone, etc). It is impressive. The short tail is firming up (chat interfaces as a big player). The long tail will blow our minds.
  3. In this post, I'm going to focus on the short tail & what we can build now as application developers, especially as SaaS app developers.

Why do we need an "AI Features Framework"?

  1. There are a finite number of AI feature categories that are being built in SaaS apps today. This will change some time in the future (maybe tomorrow, maybe in 5 years).
  2. Cataloging the finite quantity of features available today helps product teams focus on what they can build to benefit customers & where they can explore (push the boundary).

Thesis: SaaS companies (e.g., RIVET) will start to use AI (chatbot interfaces) to…

  1. Fill gaps with easy-to-implement (low-quality) product development experiences powered by a chatbot interface
  2. Plan high-quality product development experiences informed by customer usage of the chatbot interface
  3. Expose chatbot interfaces powered by data integrated from other products to provide customer value enabled by that data

The Framework

The framework has two parts:

  1. "Rails": Environmental Constraints
  2. "Building Blocks": Feature Categories by Ability
    • Example Use Cases
    • Environmental Form ("Rail")
    • Data Sources

"Rails": Environmental Constraints

How tightly does the environment constrain what the AI actor can do? I think of it as states of matter:

  1. Gas: Environments where the AI actor can operate with limited constraints. Any constraints are usually offered in the prompt/instructions to the AI or at the model-level, and therefore not changeable without switching models. No ML expertise required.
    • Example: basic image generation based on a user-provided prompt
  2. Liquid: Environments where the AI actor can operate with moderately firm constraints. These constraints are often inexpensive to change but require some engineering effort. Very little ML expertise required.
    • Examples: modifying data in an application in a pre-defined way via an API; retrieving data from a pre-defined data source such as a database or website homepage
  3. Solid: Environments where the AI actor can operate with severely strict constraints. These constraints are often expensive to set up & change. Changes to the functionality of the feature cannot be achieved without physical "rails" changes and/or advanced ML expertise.
    • Examples: self-driving car lanes, automated factory production lines, fine-tuning models using self-learning feedback loops

"Building Blocks": Feature Categories

These are the "Lego blocks" of AI products today. Each has an ability, example use cases, the rails it needs & the data it runs on.

1. (Unpredictable / Dangerous) Data Mutation, aka Generative AI

  • Example use cases: Prototyping, asset creation, document drafting
  • Environmental constraints: Gas Rails. Requires very little in the application environment on top of the base model to get started, but can expand greatly depending on how the application's users expect generation to work (e.g., generate a song vs generate a specific type of image vs generate a fullstack application)
  • Data sources: Static - e.g., an uploaded image, a chat prompt, a document with great detail on a plot for a book to be generated

2. Query (relatively) static data

  • Example use cases: Query static documents such as API documentation
  • Environmental constraints: Gas Rails. Requires static data to be fed into the application environment on top of the base model - e.g., via web scraping based on a URL or OCR of a document
  • Data sources: Static - e.g., product documentation, API documentation, customer help articles or a website's home page

3. Query dynamic data

  • Example use cases: Query an application for answers to questions involving my company's proprietary data in the SaaS application
  • Environmental constraints: Liquid Rails. Requires an interface (today, these are APIs for real-time & data streams for close-to-real-time) with usage instructions to perform approved queries
  • Data sources: Malleable - e.g., a transactional database that is hosting individual end user data (today these are queried via API for certainty)

4. Self-improving system (model fine-tuning)

  • Example use cases: Netflix's movie recommendation engine, an ever-improving project schedule builder, a personalized tutor that "learns" the best way to help me learn
  • Environmental constraints: Solid Rails. Requires a continuous feedback loop such as an ML engine fed by end user feedback - implicit (did the user pick this option or keep searching?) or explicit (thumbs up & down)
    • Note: requires model fine-tuning, which is an advanced ML practice & compute-intensive
  • Data sources: Malleable - feedback from the system's key metrics

5. (Safe) Data Mutation: agentic workflows to perform specific actions based on reasoning informed by input data

  • Example use cases:
    • "Show me options for flights from A to B on date X. Book flight Y using my credit card."
    • "Why can't I schedule more field labor? Oh, I don't have enough seats in my subscription. Increase my subscription amount using my saved billing info."
    • Self-driving cars in specific self-driving car lanes, or in specific cities that have municipal codes & streets mapped out in a way that an algorithm can take advantage of
    • "Dark Factories" where AI-enabled manufacturing machines perform actions based on very strict physical constraints
  • Environmental constraints: Solid Rails. Requires an interface (e.g., an API) with usage instructions to perform approved actions. These systems aren't AGI; they are an algorithm-behind-a-curtain that appears to be very smart.
  • Data sources: Malleable - e.g., sensor inputs, APIs returning data from a database, documents representing streets or a schematic for a widget to be built

These categories become more valuable for end user experiences when combined.


Two kinds of data: peripheral & contextual

The data fetch blocks above split along one more line that matters a lot for effort:

  • Peripheral data: public or pseudo-public data about an application & its service offerings (marketing materials, sales materials, public API documentation, user training materials). Chatbot providers like Chatbase, Ada & Intercom can ingest this out of the box via PDF upload, copy/paste, wiki integrations & website crawlers. Little to no engineering effort.
  • Contextual (in-app) data: the customer's own data in the application. This needs an API or database integration, which means real engineering effort to build & maintain.

Applying it: what could a SaaS app like RIVET build?

RIVET helps construction contractors plan & schedule their field labor. Here's how the building blocks map onto features for a product like ours.

1. Sales/Marketing chatbot (data fetch - peripheral)

  • Benefit: lets prospects learn about the product & service offerings on demand, & surfaces learning materials such as podcast bites, webinar clips & e-book excerpts
  • Effort: can be set up out of the box with existing chatbot providers. Very little to no engineering effort required.
  • User: customer prospect

2. Support chatbot

  • v1: data fetch - peripheral
    • Benefit: customers get on-demand answers to simple questions about use cases, training & documentation without waiting on a human. Should allow seamless escalation to human support.
    • Effort: out of the box with existing providers
    • User: active customer
  • Later: (safe) data mutation
    • Benefit: "Why is there a banner on my account? Oh, I haven't paid? How can I pay? Approve a transaction on my card on file."
    • Effort: significant, because it needs purpose-built APIs & integration, & the self-serve features underneath it have to exist first

3. In-app product chatbot

  • v1: data fetch - in-app
    • Benefit: customers get information about their specific data (e.g., "There is a severe weather warning for Southeast Michigan this Friday. Who is working on jobs in Southeast Michigan this Friday & Saturday?")
      • fills gaps in the current product experience with a low-quality interface
      • informs the product team of areas to focus on for high-quality interfaces to replace the chatbot
    • Effort: moderate, due to the need for API or database integration
    • User: active customer
  • v2: (safe) data mutation - in-app
    • Benefit: customers take specific actions on their data, such as "message everyone scheduled on jobs in Southeast Michigan this Friday with this content & show it to me before sending so I can approve it"
    • Effort: significant, due to the purpose-built APIs required

Example Product Roadmap

Putting it in order of delivery:

  1. AI data fetch with access to peripheral data (product help articles, podcasts, marketing material, API documentation)
    • Service customer questions about the product in sales, training & support contexts
  2. AI data fetch with access to contextual data (specific customer data in the database)
    • Unlock many new customer-driven query features
    • Use the queries customers generate in this feature to inform future product development experiences
    • Expose query features against imported partner & competitor datasets that help capture market share
  3. AI (safe) data mutation
    • Unlock many new customer-driven mutation features
    • Use the mutation queries customers generate in this feature to inform future product development experiences
    • Expose more features against imported partner & competitor datasets that help capture market share

Within step 2, the freshness of the data is its own ladder, & each rung costs more engineering than the last:

  1. Manual exports of customer data fed to the chatbot. Limited data, not real-time, no engineering effort.
  2. "Slow" in-app data: automated, batch-processed document-style exports. Still limited data, close to but not real-time. Significant engineering investment to implement & maintain.
  3. "Quick" in-app data: automated, batch-processed exports to a vector data source. Data size is no longer the chief constraint. Massive engineering investment.
  4. "Real-time" in-app data: change data capture streaming into a vector data source. 🙂 Massive engineering investment, & then some.

Technical challenges

While there are many products that offer chatbot interfaces informed by specific APIs (e.g., Chatbase) or document uploads (e.g., Pinecone Assistant), there are no systems with plug-and-play database integrations. The systems that exist today provide RAG services. Plug-and-play database services would require extremely massive & complicated document RAG implementations OR a data pipeline system that moves data into a vector database that the agent has access to.