Engineering · System Design · AI

Building MyndBase: The Architecture Behind an AI-Powered Company Brain

How I designed and built a full-stack AI platform, from a visual workflow editor and modular backend to a reusable agent execution engine and external integrations.

By Manish PoudelArchitecture overview
PythonTypeScriptReactNext.jsFastAPILangGraphPostgreSQLAlembicDockerAWSVercelAmazon Cognito

Demo video

A short product walkthrough I created in Adobe.

01. The idea behind MyndBase

MyndBase started with an idea I encountered through Y Combinator's Request for Startups material for Summer 2026: the concept of a Company Brain.

The idea was to bring knowledge from fragmented business sources together, keep it current, and turn it into reusable skills that AI agents could use to perform tasks. It made me think about building something beyond a conventional chatbot.

I wanted to build a platform where AI could work with business context, access relevant information, use external tools, and carry out tasks through structured workflows, with people remaining involved when their judgment was needed.

That became the direction for MyndBase. It is an early-stage project, and I have focused on establishing the core product and its technical foundations before expanding its capabilities.

What the platform brings together

  • Workflows: visual graphs that define how tasks should be performed.
  • Agents and skills: AI capabilities that can be composed into reusable processes.
  • Storage: files and information that workflows can access.
  • Integrations: external services and tools that provide data or perform actions.
  • Human-in-the-loop: approval steps for workflows that require human judgment.

02. High-level architecture

I designed MyndBase as a full-stack application with distinct responsibilities across the frontend, backend, agent execution package, and infrastructure.

The frontend lets users construct and manage workflows. The backend exposes APIs, handles application logic, and coordinates execution. A separate Python package handles the construction and execution of agent graphs using LangGraph.

System architecture

Frontend · Next.js and React

User interface, React Flow, providers, repositories and services

API layer · FastAPI

Versioned REST endpoints, authentication, authorization and application logic

Workflow compilation

Transforms the frontend workflow definition into an execution-ready representation

Hex Agents · LangGraph

Constructs the execution graph and runs agent workflows

PostgreSQL

Persistent application data

External tools

MCP and service integrations

Scheduling

Scheduled workflow execution

The important design decision is that the visual editor is not the execution engine. Each layer communicates through defined interfaces, allowing the user interface, application backend, and AI execution logic to evolve independently.

03. Frontend architecture

I built the frontend using Next.js and React. One of its main features is a visual workflow editor built with React Flow, which represents workflows as nodes connected by edges.

Rather than scattering HTTP requests throughout the React components, I organized frontend data access into distinct layers.

React components

Render the interface and handle user interactions

Provider layer

Exposes application data and operations to components

Repository layer

Provides a consistent interface for data access

Service layer

Encapsulates operations against backend endpoints

Centralized Axios API client

Shared HTTP configuration and request handling

The API client centralizes HTTP configuration. Service classes implement operations for resources such as workflows and chat. Repositories provide a data-access interface, while providers expose the necessary data and operations to React components.

This separation makes the code easier to reason about and maintain. A component can work with application data without needing to know the details of HTTP requests or endpoint configuration.

Authentication

I integrated Amazon Cognito for authentication. The frontend participates in the authentication flow and sends authenticated requests to the backend. The backend must still enforce authorization for protected resources; authentication alone does not determine what a user is allowed to access.

04. Backend architecture

The backend is built with FastAPI. I organized its API surface into versioned modules so that different resources can have their own routers and endpoint definitions.

api/
  v1/
    routers/
      chat/
      profile/
      workflows/
      storage/
  ...

This structure groups endpoints by responsibility and provides a foundation for evolving the API as the product grows. The routers expose REST endpoints for frontend operations, while the underlying application logic handles the corresponding operations.

Separating the API from agent execution

One of the key decisions was to keep the agent execution logic outside the main API implementation. An API endpoint should not need to contain all the details of constructing and executing an AI graph.

To establish that boundary, I created Hex Agents, a reusable Python package responsible for constructing and executing workflow graphs using LangGraph.

FastAPI handles incoming requests and application-level responsibilities. Hex Agents handles graph construction and execution. This makes the agent functionality reusable without coupling it directly to a particular API endpoint.

MCP as another interface

I also implemented Model Context Protocol (MCP) services. MCP provides a standardized way for compatible AI clients to discover and invoke tools. This complements the REST API by making selected capabilities accessible to MCP-compatible clients and integrations.

05. From a visual graph to execution

Connecting a visual workflow editor to an actual execution engine is one of the central engineering challenges in MyndBase.

React Flow provides the frontend representation of the graph: nodes and edges. That representation describes the workflow visually, but it is not itself a LangGraph execution graph. The backend bridges this difference through a compilation step.

  1. 1. Build the graph

    The user creates nodes and connections in the React Flow editor. The frontend serializes the workflow into structured data.

  2. 2. Submit the definition

    The frontend sends the workflow data to a FastAPI endpoint.

  3. 3. Compile the workflow

    The backend transforms the incoming graph representation into a structured format understood by Hex Agents.

  4. 4. Construct the execution graph

    Hex Agents uses LangGraph to construct the corresponding nodes and edges and prepare the graph for execution.

  5. 5. Execute and return results

    The workflow executes its configured operations, and the result is returned through the backend to the application.

The architectural principle

React Flow handles visual representation. The compiler translates the workflow definition. Hex Agents and LangGraph handle execution. This boundary keeps the interface separate from the implementation of the execution engine.

Scheduling and human approval

Workflows can include scheduling and interrupt steps. Scheduling enables recurring or time-based execution. Human-in-the-loop steps allow a workflow to pause and wait for approval before continuing with a sensitive or consequential operation.

For example, a workflow could prepare a business report and pause for approval before sending the report by email. This provides a way to combine automation with human oversight.

06. Data and infrastructure

I use PostgreSQL for persistent application data and Alembic to manage database schema migrations. Migration files let me track schema changes and apply them incrementally as the application evolves.

Docker provides a containerized runtime for the backend. The backend runs on AWS infrastructure, PostgreSQL provides persistent storage, and Amazon Cognito handles authentication. The Next.js frontend is deployed on Vercel and connected to GitHub for deployment from the repository.

07. A real-world use case: ChiyaTime Cafe

I used ChiyaTime Cafe, a tea café, as a practical example of how MyndBase could connect business data, AI analysis, and external actions into one workflow.

The goal was to automate the generation and delivery of a sales report. Instead of manually retrieving data, analyzing it, preparing a report, and emailing it, the process could be coordinated by a MyndBase workflow.

MyndBase workflow

Defines the sequence of operations

ChiyaTime Cafe MCP integration

Provides access to the connected sales data

Analysis and report generation

Calculates sales metrics and prepares the report

Resend API

Delivers the generated report by email

Authentication and integration

ChiyaTime Cafe uses Supabase authentication. I worked on the authentication and integration flow so that MyndBase could establish authorized access to ChiyaTime Cafe through an MCP connection.

The MCP integration exposes the relevant tools, while the workflow coordinates data retrieval, analysis, and email delivery through Resend.

Example report

For the reporting period September 1–28, 2026, the generated report included the following figures:

MetricResult
Transactions170
Net sales27,284.50
Average transaction160.50
Discounts176.00
Highest sales daySeptember 18
Lowest sales daySeptember 26

The example demonstrates the integration of multiple system components: workflow construction, backend execution, external data access through MCP, report generation, and email delivery.

Rather than treating AI as an isolated text-generation step, MyndBase coordinates a sequence of operations that produces a useful business outcome.

08. Design decisions and learnings

Building MyndBase has given me hands-on experience across frontend engineering, backend design, AI execution, database management, and deployment.

Separation of responsibilities

The frontend, API layer, compiler, and agent execution package have distinct responsibilities. This makes it easier to reason about each part and reduce unnecessary coupling.

Reusable components

The frontend data-access layers and the Hex Agents package establish reusable interfaces rather than duplicating implementation details across components.

Integrations as part of the architecture

MCP and external service connections allow workflows to work with business systems beyond the platform itself.

Reliability remains an ongoing challenge

Building an agent workflow engine also means dealing with execution failures, permissions, state management, observability, and the reliability of model-generated decisions. These are areas I continue to consider as the product evolves.

Conclusion

MyndBase began with the idea of a Company Brain and developed into a platform for connecting business knowledge, AI agents, workflows, and external tools.

Building it has involved much more than integrating an LLM into an application. I have worked across the frontend, backend, workflow compilation, agent execution, authentication, database migrations, external integrations, and cloud deployment.

The project is still evolving, but its core architecture provides a foundation for building AI-powered business workflows. My focus is on creating systems where AI operates within a structured software environment and helps people accomplish practical tasks.

Explore MyndBase

See the product and its current capabilities.

Visit MyndBase ↗