@@ -11,6 +11,10 @@ const llm = ai({
1111const flowFull = AxFlow . create < { documentContent : string } > ( {
1212 autoParallel : true ,
1313} )
14+ . description (
15+ 'Document Analysis Pipeline' ,
16+ 'Summarizes a document, extracts keywords, and analyzes sentiment.'
17+ )
1418 . node ( 'summarizer' , 'documentContent:string -> documentSummary:string' )
1519 . node ( 'keywordExtractor' , 'documentSummary:string -> keywords:string[]' )
1620 . node (
@@ -37,6 +41,10 @@ const flowFull = AxFlow.create<{ documentContent: string }>({
3741
3842// Aliases example 1 - Customer support ticket processing with error handling
3943const flowAlias1 = AxFlow . create < { ticketMessage : string } > ( )
44+ . description (
45+ 'Support Ticket Processor' ,
46+ 'Classifies incoming support messages and generates a suggested response.'
47+ )
4048 . n (
4149 'classifier' ,
4250 'customerMessage:string -> ticketCategory:string, urgencyLevel:string'
@@ -59,6 +67,10 @@ const flowAlias2 = AxFlow.create<
5967> ( {
6068 autoParallel : true ,
6169} )
70+ . description (
71+ 'Code Review Assistant' ,
72+ 'Analyzes a code snippet and produces a concise review with quality score.'
73+ )
6274 . n (
6375 'codeAnalyzer' ,
6476 'sourceCode:string -> codeAnalysis:string, qualityScore:number'
@@ -79,6 +91,10 @@ const flowBranch = AxFlow.create<
7991 { userPost : string ; postType : string } ,
8092 { moderationAction : string }
8193> ( )
94+ . description (
95+ 'Content Moderation Router' ,
96+ 'Routes content to the appropriate moderator and returns the moderation action.'
97+ )
8298 . node (
8399 'socialMediaModerator' ,
84100 'postContent:string -> moderationDecision:string, reasoning:string'
@@ -102,6 +118,10 @@ const flowBranch = AxFlow.create<
102118
103119// Parallel example - Research paper analysis with manual parallelization
104120const flowParallel = flow < { paperAbstract : string } > ( )
121+ . description (
122+ 'Research Paper Scorer' ,
123+ 'Scores novelty and clarity in parallel and computes a combined score.'
124+ )
105125 . node ( 'noveltyScorer' , 'researchAbstract:string -> noveltyScore:number' )
106126 . node ( 'clarityScorer' , 'researchAbstract:string -> clarityScore:number' )
107127 . parallel ( [
@@ -134,6 +154,10 @@ const flowParallel = flow<{ paperAbstract: string }>()
134154
135155// While example - Iterative writing improvement with circuit breaker
136156const flowWhile = AxFlow . create < { draftArticle : string } > ( )
157+ . description (
158+ 'Iterative Writing Improver' ,
159+ 'Loops to improve article quality until the target is reached.'
160+ )
137161 . node (
138162 'qualityEvaluator' ,
139163 'articleDraft:string -> qualityScore:number, qualityFeedback:string'
@@ -160,6 +184,10 @@ const flowWhile = AxFlow.create<{ draftArticle: string }>()
160184
161185// Multi-hop RAG example - Research question answering with concurrency control
162186const flowRAG = AxFlow . create < { researchQuestion : string } > ( )
187+ . description (
188+ 'Multi-hop Research QA' ,
189+ 'Generates a query, retrieves context, and answers a research question.'
190+ )
163191 . node ( 'queryGenerator' , 'researchQuestion:string -> searchQuery:string' )
164192 . node ( 'retriever' , 'searchQuery:string -> retrievedDocument:string' )
165193 . node (
@@ -182,6 +210,10 @@ const flowRAG = AxFlow.create<{ researchQuestion: string }>()
182210
183211// Batched parallel example - Processing multiple documents with concurrency control
184212const flowBatchedParallel = flow < { documentBatch : string } > ( )
213+ . description (
214+ 'Batched Parallel Processor' ,
215+ 'Processes a batch through multiple processors with limited concurrency.'
216+ )
185217 . node ( 'processor1' , 'batchData:string -> processedResult1:string' )
186218 . node ( 'processor2' , 'batchData:string -> processedResult2:string' )
187219 . node ( 'processor3' , 'batchData:string -> processedResult3:string' )
0 commit comments