Generation Flow Architecture
Generation Flow (genflow) represents the fundamental architectural pattern in Teammately's AI engineering framework. It utilizes a component-based approach to large language model (LLM) orchestration, enabling modular construction of complex AI systems with enhanced maintainability and iterative refinement capabilities.
Architectural Components​
A Generation Flow includes the following principal components:
-
Input Schema - Defines the structured format of variables transmitted through the API from client applications and sets up validation and constraint enforcement.
-
Prompt Book - Contains an AI Agent prompt for specific use case. Can be written manually or generated using Teammately Agent. Also, specifies model selection, para,eters, configuration and supports multi-step generation through sequential prompt orchestration.
-
Knowledge Book - Includes documents text knowledge for retrieval-augmented generation (RAG) and configurable chunking strategies. Specifies embedding model selection for vector representation.
-
Output Schema - Specifies the structured format of variables returned to client applications.
Variables and References​
Within Generation Flow, variables and flow references provide powerful capabilities:
-
Variable Usage - Variables can be accessed in prompts using double curly braces syntax
{{variable_name}}
. This allows dynamic insertion of input values into prompts. -
Genflow References - One genflow can reference another as input by using the same syntax:
{{genflow_id}}
. This enables composition of multiple flows and creation of complex chains. -
JSON Output - When using JSON schema for output, the prompt must include the word "json" anywhere in the text to properly trigger structured output parsing.
Production Deployment​
When deployed to production environments, Generation Flows are exposed as API endpoints with consistent interfaces. Each deployed flow:
- Accepts structured input conforming to the defined Input Schema
- Processes the input through the configured Prompt and Knowledge Books
- Returns responses structured according to the Output Schema
- Provides optional logging and callback capabilities for asynchronous operation
Development Workflow​
The Generation Flow development lifecycle typically progresses through the following phases:
- PRD Definition - Establishing requirements and evaluation criteria
- Component Development - Creating and configuring individual components
- Quick Testing - Preliminary validation against representative cases
- Comprehensive Evaluation - Thorough testing across diverse scenarios
- Optimization - Refinement based on evaluation insights
- Deployment - Production release with monitoring capabilities
This structured approach ensures methodical development of high-quality AI systems aligned with specified requirements.