DEV Community

Cover image for Getting Started - Build AI Platforms From Scratch #1
Nick Goldstein
Nick Goldstein

Posted on

Getting Started - Build AI Platforms From Scratch #1

Build AI Platforms from Scratch

Learn to build powerful AI-powered applications and platforms from scratch. This course focuses on design, architecture, and engineering, NOT coding.

📺 View this module with video & slides

Before We Get Started

Please consider the following before proceeding:

  • NOTE: This is NOT a coding course. This series will strictly focus on the design, architecture, and engineering choices involved in building an AI platform/app.
  • Despite this not being a coding course, we will provide a Github repo with some common coding patterns that you will likely utilize at some point in the process of building an AI platform.
  • This course is for beginners who want to take advantage of LLMs, and other AI technologies in their projects. The content will be geared more toward ambitious and complex projects that want to make use of things like multi-layered AI architectures, data transformations through LLMs, agents, ambient intelligence, etc., rather than something like a simple chatbot.

Key Terms & Definitions

Important concepts and terminology used throughout this course:

LLM (Large Language Model)

A type of AI trained on massive amounts of text that can understand and generate human language.

Agents

AI systems that can take actions and make decisions autonomously to accomplish goals, not just answer questions.

AI Architecture

How you structure and organize the different components of your AI system to work together.

Data Transformation Through LLMs

Using AI to convert information from one format to another—like turning messy user input into structured data.

Prompt Engineering

The practice of writing instructions to AI models to get reliable, useful outputs.

Tech Stack

The collection of technologies and tools you use to build your platform—programming languages, frameworks, databases, etc.

IDE (Integrated Development Environment)

The software where you write your code.

MToks (Million Tokens)

Standard unit for measuring large-scale API usage. 1 MTok = 1,000,000 tokens.

APIs (Application Programming Interfaces)

How your code communicates with external services like AI providers.

Industry Benchmarks

Standard metrics and performance expectations for AI systems in production.

Input/Output (in LLM APIs)

Input = what you send to the AI. Output = what it generates back. Output typically costs more.

Context Windows

The total amount of text an AI model can process at once, including your instructions and its response.

Tokens

The basic units AI models use to read and generate text. Roughly 1 token = 0.75 words.

AI Hallucination

When AI generates plausible-sounding information that's actually incorrect or made up.

Systems Thinking

Designing platforms as interconnected parts rather than isolated features, focusing on how components interact.

Course Specs

Broad agenda of what you'll receive in future modules:

  • A comprehensive understanding of what building an AI platform entails
  • Actionable steps to develop your own AI-powered application
  • Real-world examples of AI platforms and how they were built
  • Prompt Engineering for complex projects (Modularity, Inputs/Outputs, Preventing Bad Behavior, etc.)
  • Considerations regarding design and user experience
  • Multi-layered AI workflows and data transformations
  • Tracking AI usage and limiting tokens while maintaining accurate responses

Tech Stack

The tools and technologies I use in my projects most frequently:

  • Frontend (Web): Typescript/Vite & Tailwind
  • Mobile: Flutter
  • Backend: Go (Gin)
  • DB: PostgreSQL, GORM
  • LLM API: Anthropic, OpenAI (Sometimes - mostly as backup), Mistral (For simple tasks)
  • TTS API: OpenAI TTS
  • IDE: Cursor
  • Cloud Hosting: Digital Ocean
  • Image and Video Hosting: Cloudinary

NOTE: Architectural concepts apply regardless of stack.

Structure of Course Topics

How we'll lay out easily digestible info:

  1. Introduction/definition of a common issue or a foundational concept
  2. Real world story involving this topic in either one of my projects or a well-known platform elsewhere and its resolution
  3. The decision making process breakdown and specifics that should inform build
  4. Major takeaways from previous slides and how to apply this to your own project

My Projects

What I've built using the methods that I'm sharing in this course:

Emstrata

A text-based emergent storycraft simulator where stories unfold like lived experiences. Participants make choices that shape narrative worlds, AI systems maintain continuity and consistency, and users can interact with the simulation—altering mid-flight, navigating AI-generated planes, making inquiries, and correcting errors.

PLATO5 (In the middle of a redesign)

An AI-first social engine designed to generate real-world friendships, not screen time. It matches people based on personality (Big 5 traits), interests, and location, facilitates conversations through "Zen—an AI chat manager," and guides users toward planning actual meetups, with the goal of getting people off the app and into real life.

Why Build AI Platforms

Novel applications of AI are best for this:

  • When you're building something that doesn't exist yet, you need architecture designed specifically for that problem
  • Complex AI applications require precise control over how prompts are structured, how state is managed across multiple AI calls, and how data flows between different parts of the system
  • Building from scratch means you can optimize every layer for your specific use case—from how you call the AI to how you handle edge cases to how you manage costs at scale
  • The architecture choices you make define what's possible. Emstrata's multi-layer narrative system works because the entire platform is built around maintaining continuity and tracking story threads

The Cost Reality of AI Apps

How much an AI application will cost to run, test, and maintain:

  • AI API usage: Usage is measured in tokens (MToks). Different models and APIs have varying charges and strengths not always reflected in benchmarks.
  • Input and Output costs: Input and output tokens often have different prices, with output tokens typically costing more. Applications generating large AI responses will incur higher costs, especially compared to those with larger context windows.
  • Context window size: The size of the context window affects not only prices but also performance. It's important to manage the amount of tokens sent to the API and prefer standardized methods for controlling and organizing tokens into easily readable inputs.

Apps that Evolve

Building for the unpredictability of AI:

  • AIs hallucinate. You likely already know this if you're considering building an AI platform, but consider that the scale of the hallucination and the downstream effects of them can expand exponentially with architecture and design that rests on the accuracy of AI responses. A lot of this course will cover this reality and demonstrate ways to hedge against these unfortunate issues or embrace them in interesting ways.
  • Luckily, many hallucinations can be stamped out, accounted for, or predicted in the course of designing your app. This will require persistence, trial and error, and a level of systems-thinking.
  • All in all, this is a feature, not a bug. The reason AIs hallucinate is the same reason that we will receive different responses to the same input and the AI can mimic human creative capacity.

External Resources

Repo w/ Common Code Patterns

Common code patterns and examples from the course.

System Prompt Generator

A tool for generating effective system prompts for AI platforms.

Emstrata

A platform for creating immersive narrative experiences using AI to generate emergent storylines.

PLATO5

A social engine designed to turn online connections into real-world friendships, with AI integration to facilitate conversations.

Top comments (0)