AI Nodes

> Integrate AI capabilities into your routes -- generate text, answer questions, and process natural language.

AI nodes let you call AI models directly from your flow without managing API keys or parsing model responses yourself. They require sequence connections because they make external calls to AI services.

Text Generation

brickr-ai

Brickr's built-in AI node. Sends a prompt to the Brickr AI service and returns the generated response. This is the simplest way to add AI capabilities to your routes.

| Pin | Direction | Type | |-----|-----------|------| | sequence in | Input | sequence | | prompt | Input | string | | response | Output | string | | sequence out | Output | sequence |

Use brickr-ai for quick AI integrations where you want Brickr to handle model selection and configuration automatically.

prompt-ai

Sends a prompt to an AI language model with full control over model parameters and returns the generated response.

| Pin | Direction | Type | |-----|-----------|------| | sequence in | Input | sequence | | prompt | Input | string | | systemPrompt | Input | string | | model | Input | string | | temperature | Input | number | | response | Output | string | | sequence out | Output | sequence |

The prompt input is the user-facing message or question. The systemPrompt input sets the behavior and context for the AI model (e.g., "You are a helpful customer support agent"). The model input selects which AI model to use. The temperature input controls randomness (0 for deterministic, higher values for more creative responses).

The available models depend on your workspace plan. Check your workspace settings for the list of models you can use.

For consistent, predictable outputs (like data extraction or classification), use a low temperature (0 to 0.3). For creative tasks (like generating marketing copy or brainstorming), use a higher temperature (0.7 to 1.0).

Common Patterns

AI-powered API responses

1. Use get-body to read the user's question from the request. 2. Use prompt-ai to generate an answer. 3. Use combine-object (Make Object) to wrap the response in a structured format. 4. Use return-json to return it.

Content moderation

1. Use get-body to read user-submitted content from the request. 2. Use prompt-ai with a system prompt that instructs the model to flag inappropriate content. 3. Use if-condition to branch based on whether the content passes moderation. 4. Use return-json to send back the moderation result.