Skip to content

AI & LLM

AI model integration, text generation, embeddings, and autonomous agents.

18 modules

ModuleDescription
Agent Tự độngAgent AI tự điều khiển với bộ nhớ và hành vi hướng mục tiêu
Agent ChuỗiChuỗi xử lý AI tuần tự với nhiều bước
Agent Sử Dụng Công CụAI Agent có thể gọi công cụ/chức năng
Nhúng Văn BảnTạo vector nhúng từ văn bản bằng mô hình AI
Trích Xuất AITrích xuất dữ liệu có cấu trúc từ văn bản bằng AI
Trò chuyện Ollama cục bộTrò chuyện với LLM cục bộ qua Ollama (hoàn toàn ngoại tuyến)
Bộ nhớ AIBộ nhớ hội thoại cho AI Agent
Bộ nhớ thực thểTrích xuất và theo dõi thực thể (người, địa điểm, khái niệm) từ hội thoại
Bộ nhớ RedisBộ nhớ hội thoại lâu dài sử dụng lưu trữ Redis
Bộ nhớ VectorBộ nhớ ngữ nghĩa sử dụng vector embeddings để truy xuất ngữ cảnh liên quan
Model AICấu hình model LLM cho AI Agent
AI ToolExpose a module as a tool for AI Agent
Phân Tích Thị GiácPhân tích hình ảnh bằng mô hình AI thị giác
Trò chuyện ClaudeGửi tin nhắn chat đến Anthropic Claude AI và nhận phản hồi
Trò chuyện Google GeminiGửi tin nhắn chat đến Google Gemini AI và nhận phản hồi
Trò chuyện OpenAIGửi tin nhắn chat đến các model GPT OpenAI
Tạo hình ảnh DALL-ETạo hình ảnh sử dụng DALL-E
AI AgentAgent AI tự động với kết nối đa cổng (model, memory, tools)

Modules

Agent Tự động

agent.autonomous

Agent AI tự điều khiển với bộ nhớ và hành vi hướng mục tiêu

Parameters:

NameTypeRequiredDefaultDescription
goalstringYes-Mục tiêu để agent đạt được
contextstringNo-Mục tiêu để agent đạt được
max_iterationsnumberNo5Ngữ cảnh hoặc ràng buộc bổ sung
llm_providerselect (openai, ollama)NoopenaiSố bước suy luận tối đa
modelstringNogpt-4-turbo-previewTên model (ví dụ: gpt-4, llama2, mistral)
ollama_urlstringNohttp://localhost:11434Tên model (ví dụ: gpt-4, llama2, mistral)
temperaturenumberNo0.7URL máy chủ Ollama (chỉ cho provider ollama)

Output:

FieldTypeDescription
resultstringMức độ sáng tạo (0-2)
thoughtsarrayKết quả thao tác
iterationsnumberKết quả thao tác
goal_achievedbooleanCác bước suy luận của Agent

Example: Research task

yaml
goal: Research the latest trends in AI and summarize the top 3
max_iterations: 5
model: gpt-4

Example: Problem solving

yaml
goal: Find the best approach to optimize database queries
context: PostgreSQL database with 10M records
max_iterations: 10

Agent Chuỗi

agent.chain

Chuỗi xử lý AI tuần tự với nhiều bước

Parameters:

NameTypeRequiredDefaultDescription
inputstringYes-Đầu vào ban đầu cho chuỗi
chain_stepsarrayYes-Đầu vào ban đầu cho chuỗi
llm_providerselect (openai, ollama)NoopenaiMảng các bước xử lý (mỗi bước là một template prompt)
modelstringNogpt-4-turbo-previewTên model (ví dụ: gpt-4, llama2, mistral)
ollama_urlstringNohttp://localhost:11434Tên model (ví dụ: gpt-4, llama2, mistral)
temperaturenumberNo0.7URL máy chủ Ollama (chỉ cho provider ollama)

Output:

FieldTypeDescription
resultstringMức độ sáng tạo (0-2)
intermediate_resultsarrayKết quả thao tác
steps_completednumberKết quả thao tác

Example: Content pipeline

yaml
input: AI and machine learning trends
chain_steps: ["Generate 5 blog post ideas about: {input}", "Take the first idea and write a detailed outline: {previous}", "Write an introduction paragraph based on: {previous}"]
model: gpt-4

Example: Data analysis chain

yaml
input: User behavior data shows 60% bounce rate
chain_steps: ["Analyze what might cause this issue: {input}", "Suggest 3 solutions based on: {previous}", "Create an action plan from: {previous}"]

Agent Sử Dụng Công Cụ

agent.tool_use

AI Agent có thể gọi công cụ/chức năng

Parameters:

NameTypeRequiredDefaultDescription
promptstringYes-Mục tiêu hoặc nhiệm vụ cho agent
toolsarrayYes-Danh sách định nghĩa công cụ [{name, description, parameters}]
providerselect (openai, anthropic)NoopenaiNhà cung cấp LLM cho agent
modelstringNogpt-4oMô hình sẽ sử dụng
api_keystringNo-Khóa API (sử dụng biến môi trường nếu không có)
max_iterationsnumberNo10Số vòng gọi công cụ tối đa
system_promptstringNo-Lời nhắc hệ thống tùy chọn để hướng dẫn agent

Output:

FieldTypeDescription
resultstringPhản hồi cuối cùng của agent
tool_callsarrayTất cả các lần gọi công cụ trong quá trình thực thi
iterationsnumberSố vòng lặp đã hoàn thành
modelstringMô hình đã sử dụng

Example: File Processing Agent

yaml
prompt: Read the config file and update the version number
tools: [{"name": "read_file", "description": "Read contents of a file", "parameters": {"type": "object", "properties": {"path": {"type": "string", "description": "File path"}}, "required": ["path"]}}, {"name": "write_file", "description": "Write contents to a file", "parameters": {"type": "object", "properties": {"path": {"type": "string", "description": "File path"}, "content": {"type": "string", "description": "File content"}}, "required": ["path", "content"]}}]
provider: openai
model: gpt-4o
max_iterations: 5

Nhúng Văn Bản

ai.embed

Tạo vector nhúng từ văn bản bằng mô hình AI

Parameters:

NameTypeRequiredDefaultDescription
textstringYes-Văn bản cần nhúng
providerselect (openai, local)NoopenaiNhà cung cấp AI cho nhúng
modelstringNotext-embedding-3-smallMô hình nhúng để sử dụng
api_keystringNo-Khóa API (sử dụng biến môi trường nếu không có)
dimensionsnumberNo-Số chiều nhúng (cho các mô hình hỗ trợ)

Output:

FieldTypeDescription
embeddingsarrayMảng vector nhúng
modelstringMô hình sử dụng để nhúng
dimensionsnumberSố chiều trong vector nhúng
token_countnumberSố lượng token đã xử lý

Example: Single Text Embedding

yaml
text: The quick brown fox jumps over the lazy dog
provider: openai
model: text-embedding-3-small

Example: Reduced Dimensions

yaml
text: Semantic search query
provider: openai
model: text-embedding-3-small
dimensions: 256

Trích Xuất AI

ai.extract

Trích xuất dữ liệu có cấu trúc từ văn bản bằng AI

Parameters:

NameTypeRequiredDefaultDescription
textstringYes-Văn bản cần trích xuất dữ liệu
schemaobjectYes-JSON schema định nghĩa các trường cần trích xuất
instructionsstringNo-Hướng dẫn trích xuất bổ sung
providerselect (openai, anthropic)NoopenaiNhà cung cấp AI để sử dụng
modelstringNogpt-4o-miniMô hình sử dụng để trích xuất
api_keystringNo-Khóa API (sử dụng biến môi trường nếu không có)
temperaturenumberNo0Nhiệt độ mẫu (0-2)

Output:

FieldTypeDescription
extractedobjectDữ liệu có cấu trúc đã trích xuất
modelstringMô hình sử dụng để trích xuất
raw_responsestringPhản hồi thô của mô hình

Example: Extract Contact Info

yaml
text: John Smith is a senior engineer at Acme Corp. Email: john@acme.com
schema: {"type": "object", "properties": {"name": {"type": "string"}, "title": {"type": "string"}, "company": {"type": "string"}, "email": {"type": "string"}}}
provider: openai
model: gpt-4o-mini

Example: Extract Invoice Data

yaml
text: Invoice #1234 from Acme Corp. Total: $500.00. Due: 2024-03-01
schema: {"type": "object", "properties": {"invoice_number": {"type": "string"}, "vendor": {"type": "string"}, "total": {"type": "number"}, "due_date": {"type": "string"}}}
instructions: Extract all invoice fields. Parse amounts as numbers.

Trò chuyện Ollama cục bộ

ai.local_ollama.chat

Trò chuyện với LLM cục bộ qua Ollama (hoàn toàn ngoại tuyến)

Parameters:

NameTypeRequiredDefaultDescription
promptstringYes-Tin nhắn gửi đến LLM cục bộ
modelselect (llama2, llama2:13b, llama2:70b, mistral, mixtral, codellama, codellama:13b, phi, neural-chat, starling-lm)Nollama2Tin nhắn gửi đến LLM cục bộ
temperaturenumberNo0.7Nhiệt độ lấy mẫu (0-2)
system_messagestringNo-Tin nhắn vai trò hệ thống (tùy chọn)
ollama_urlstringNohttp://localhost:11434Tin nhắn vai trò hệ thống (tùy chọn)
max_tokensnumberNo-URL máy chủ Ollama

Output:

FieldTypeDescription
responsestringSố token tối đa trong phản hồi (tùy chọn, phụ thuộc model)
modelstringPhản hồi từ thao tác
contextarrayPhản hồi từ thao tác
total_durationnumberTên hoặc định danh model
load_durationnumberNgữ cảnh hội thoại cho các yêu cầu tiếp theo
prompt_eval_countnumberTổng thời gian xử lý
eval_countnumberThời gian tải model

Example: Simple local chat

yaml
prompt: Explain quantum computing in 3 sentences
model: llama2

Example: Code generation with local model

yaml
prompt: Write a Python function to calculate fibonacci numbers
model: codellama
temperature: 0.2
system_message: You are a Python programming expert. Write clean, efficient code.

Example: Local reasoning task

yaml
prompt: What are the pros and cons of microservices architecture?
model: mistral
temperature: 0.7

Bộ nhớ AI

ai.memory

Bộ nhớ hội thoại cho AI Agent

Parameters:

NameTypeRequiredDefaultDescription
memory_typeselect (buffer, window, summary)YesbufferLoại lưu trữ bộ nhớ
window_sizenumberNo10Số tin nhắn gần đây để giữ (cho bộ nhớ cửa sổ)
session_idstringNo-Định danh duy nhất cho phiên hội thoại này
initial_messagesarrayNo[]Lịch sử hội thoại đã tải sẵn

Output:

FieldTypeDescription
memory_typestringLịch sử hội thoại đã tải sẵn
session_idstringLịch sử hội thoại đã tải sẵn
messagesarrayLoại bộ nhớ
configobjectĐịnh danh phiên

Example: Simple Buffer Memory

yaml
memory_type: buffer

Example: Window Memory (last 5 messages)

yaml
memory_type: window
window_size: 5

Bộ nhớ thực thể

ai.memory.entity

Trích xuất và theo dõi thực thể (người, địa điểm, khái niệm) từ hội thoại

Parameters:

NameTypeRequiredDefaultDescription
entity_typesmultiselectNo['person', 'organization', 'location']Types of entities to extract and track
extraction_modelselect (llm, spacy, regex)YesllmModel for entity extraction
session_idstringNo-Unique identifier for this memory session
track_relationshipsbooleanNoTrueTrack relationships between entities
max_entitiesnumberNo100Maximum number of entities to remember

Output:

FieldTypeDescription
memory_typestringSố lượng thực thể tối đa để nhớ
session_idstringSố lượng thực thể tối đa để nhớ
entitiesobjectLoại bộ nhớ (entity)
relationshipsarrayĐịnh danh phiên
configobjectCác thực thể được theo dõi theo loại

Example: People & Organizations

yaml
entity_types: ["person", "organization"]
extraction_model: llm

Example: Full Entity Tracking

yaml
entity_types: ["person", "organization", "location", "concept"]
track_relationships: true
max_entities: 200

Bộ nhớ Redis

ai.memory.redis

Bộ nhớ hội thoại lâu dài sử dụng lưu trữ Redis

Parameters:

NameTypeRequiredDefaultDescription
redis_urlstringYesredis://localhost:6379Redis connection URL
key_prefixstringNoflyto:memory:Prefix for all Redis keys
session_idstringYes-Unique identifier for this memory session
ttl_secondsnumberNo86400Time-to-live for memory entries (0 = no expiry)
max_messagesnumberNo100Maximum messages to store per session
load_on_startbooleanNoTrueLoad existing messages from Redis on initialization

Output:

FieldTypeDescription
memory_typestringTải tin nhắn hiện có từ Redis khi khởi tạo
session_idstringTải tin nhắn hiện có từ Redis khi khởi tạo
messagesarrayLoại bộ nhớ (redis)
connectedbooleanĐịnh danh phiên
configobjectLịch sử tin nhắn đã tải

Example: Local Redis

yaml
redis_url: redis://localhost:6379
session_id: my-session
ttl_seconds: 3600

Example: Cloud Redis with Auth

yaml
redis_url: redis://:password@redis-cloud.example.com:6379
session_id: user-session
ttl_seconds: 86400
max_messages: 500

Bộ nhớ Vector

ai.memory.vector

Bộ nhớ ngữ nghĩa sử dụng vector embeddings để truy xuất ngữ cảnh liên quan

Parameters:

NameTypeRequiredDefaultDescription
embedding_modelselect (text-embedding-3-small, text-embedding-3-large, text-embedding-ada-002, local)Yestext-embedding-3-smallModel to use for generating embeddings
top_knumberNo5Number of most relevant memories to retrieve
similarity_thresholdnumberNo0.7Minimum similarity score (0-1) for retrieval
session_idstringNo-Unique identifier for this memory session
include_metadatabooleanNoTrueInclude timestamp and other metadata with memories

Output:

FieldTypeDescription
memory_typestringBao gồm dấu thời gian và metadata khác với bộ nhớ
session_idstringBao gồm dấu thời gian và metadata khác với bộ nhớ
embedding_modelstringLoại bộ nhớ (vector)
configobjectĐịnh danh phiên

Example: Default Vector Memory

yaml
embedding_model: text-embedding-3-small
top_k: 5

Example: High Precision Memory

yaml
embedding_model: text-embedding-3-large
top_k: 10
similarity_threshold: 0.85

Model AI

ai.model

Cấu hình model LLM cho AI Agent

Parameters:

NameTypeRequiredDefaultDescription
providerselect (openai, anthropic, ollama)NoopenaiAI model provider
modelstringNogpt-4oSpecific model to use
temperaturenumberNo0.7Creativity level (0=deterministic, 1=creative)
api_keystringNo-API key (defaults to provider env var)
base_urlstringNo-Custom API base URL (for Ollama or proxies)
max_tokensnumberNo4096Số token tối đa trong phản hồi

Output:

FieldTypeDescription
providerstringSố token tối đa trong phản hồi
modelstringTên nhà cung cấp LLM
configobjectTên nhà cung cấp LLM

Example: OpenAI GPT-4

yaml
provider: openai
model: gpt-4o
temperature: 0.7

Example: Anthropic Claude

yaml
provider: anthropic
model: claude-3-5-sonnet-20241022
temperature: 0.5

AI Tool

ai.tool

Expose a module as a tool for AI Agent

Parameters:

NameTypeRequiredDefaultDescription
module_idstringYes-Module ID to expose as tool (e.g. http.request, data.json_parse)
tool_descriptionstringNo-Custom description for the agent (overrides module default)

Output:

FieldTypeDescription
module_idstringModule ID exposed as tool

Example: HTTP Request Tool

yaml
module_id: http.request

Example: JSON Parse Tool

yaml
module_id: data.json_parse

Phân Tích Thị Giác

ai.vision.analyze

Phân tích hình ảnh bằng mô hình AI thị giác

Parameters:

NameTypeRequiredDefaultDescription
image_pathstringNo-Đường dẫn cục bộ đến tệp hình ảnh
image_urlstringNo-URL của hình ảnh cần phân tích
promptstringNoDescribe this image in detailNội dung cần phân tích hoặc hỏi về hình ảnh
providerselect (openai, anthropic)NoopenaiNhà cung cấp AI cho phân tích thị giác
modelstringNogpt-4oMô hình thị giác để sử dụng
api_keystringNo-Khóa API (sử dụng biến môi trường nếu không có)
max_tokensnumberNo1000Số lượng token tối đa trong phản hồi
detailselect (low, high, auto)NoautoMức độ chi tiết của hình ảnh (thấp/cao/tự động)

Output:

FieldTypeDescription
analysisstringPhân tích AI của hình ảnh
modelstringMô hình sử dụng để phân tích
providerstringNhà cung cấp sử dụng để phân tích
tokens_usednumberSố lượng token đã sử dụng

Example: Analyze Screenshot

yaml
image_path: /tmp/screenshot.png
prompt: Describe what you see in this UI screenshot
provider: openai
model: gpt-4o

Example: Analyze from URL

yaml
image_url: https://example.com/photo.jpg
prompt: What objects are in this image?
provider: anthropic
model: claude-sonnet-4-20250514

Trò chuyện Claude

api.anthropic.chat

Gửi tin nhắn chat đến Anthropic Claude AI và nhận phản hồi

Parameters:

NameTypeRequiredDefaultDescription
api_keystringNo-Khóa API Anthropic (mặc định là env.ANTHROPIC_API_KEY)
modelstringNoclaude-3-5-sonnet-20241022Model Claude để sử dụng
messagesarrayYes-Mảng các đối tượng tin nhắn với role và content
max_tokensnumberNo1024Nội dung trả về từ thao tác
temperaturenumberNo1.0Nhiệt độ lấy mẫu (0-1). Giá trị cao hơn làm đầu ra ngẫu nhiên hơn
systemstringNo-Prompt hệ thống để hướng dẫn hành vi Claude

Output:

FieldTypeDescription
contentstringPrompt hệ thống để hướng dẫn hành vi Claude
modelstringVăn bản phản hồi Claude
stop_reasonstringModel được sử dụng cho phản hồi
usageobjectTại sao model ngừng tạo (end_turn, max_tokens, v.v.)

Example: Simple question

yaml
messages: [{"role": "user", "content": "What is the capital of France?"}]
max_tokens: 100

Example: Text summarization

yaml
system: You are a helpful assistant that summarizes text concisely.
messages: [{"role": "user", "content": "Summarize this article: ${article_text}"}]
max_tokens: 500

Trò chuyện Google Gemini

api.google_gemini.chat

Gửi tin nhắn chat đến Google Gemini AI và nhận phản hồi

Parameters:

NameTypeRequiredDefaultDescription
api_keystringNo-Khóa API Google AI (mặc định là env.GOOGLE_AI_API_KEY)
modelstringNogemini-1.5-proModel Gemini để sử dụng
promptstringYes-Prompt văn bản gửi đến Gemini
temperaturenumberNo1.0Kiểm soát tính ngẫu nhiên (0-2). Giá trị cao hơn làm đầu ra ngẫu nhiên hơn
max_output_tokensnumberNo2048Số token tối đa trong phản hồi

Output:

FieldTypeDescription
textstringGenerated text response from Gemini
modelstringModel used for generation
candidatesarrayAll candidate responses

Example: Simple question

yaml
prompt: Explain quantum computing in simple terms

Example: Content generation

yaml
prompt: Write a professional email about ${topic}
temperature: 0.7
max_output_tokens: 500

Trò chuyện OpenAI

api.openai.chat

Gửi tin nhắn chat đến các model GPT OpenAI

Parameters:

NameTypeRequiredDefaultDescription
promptstringYes-Tin nhắn gửi đến GPT
modelselect (gpt-4-turbo-preview, gpt-4, gpt-3.5-turbo)Nogpt-4-turbo-previewTin nhắn gửi đến GPT
temperaturenumberNo0.7Nhiệt độ lấy mẫu (0-2)
max_tokensnumberNo1000Nhiệt độ lấy mẫu (0-2)
system_messagestringNo-Số token tối đa trong phản hồi

Output:

FieldTypeDescription
responsestringTin nhắn vai trò hệ thống (tùy chọn)
modelstringPhản hồi từ thao tác
usageobjectPhản hồi từ thao tác

Example: Simple chat

yaml
prompt: Explain quantum computing in 3 sentences
model: gpt-3.5-turbo

Example: Code generation

yaml
prompt: Write a Python function to calculate fibonacci numbers
model: gpt-4
temperature: 0.2
system_message: You are a Python programming expert

Tạo hình ảnh DALL-E

api.openai.image

Tạo hình ảnh sử dụng DALL-E

Parameters:

NameTypeRequiredDefaultDescription
promptstringYes-Mô tả hình ảnh cần tạo
sizeselect (256x256, 512x512, 1024x1024, 1792x1024, 1024x1792)No1024x1024Mô tả hình ảnh cần tạo
modelselect (dall-e-3, dall-e-2)Nodall-e-3Phiên bản model DALL-E
qualityselect (standard, hd)NostandardChất lượng hình ảnh (chỉ DALL-E 3)
nnumberNo1Số hình ảnh tạo ra (1-10)

Output:

FieldTypeDescription
imagesarrayList of generated images
modelstringModel name or identifier

Example: Generate artwork

yaml
prompt: A serene mountain landscape at sunset, digital art
size: 1024x1024
model: dall-e-3
quality: hd

Example: Create logo

yaml
prompt: Modern tech startup logo with blue and green colors
size: 512x512
model: dall-e-2
n: 3

AI Agent

llm.agent

Agent AI tự động với kết nối đa cổng (model, memory, tools)

Parameters:

NameTypeRequiredDefaultDescription
prompt_sourceselect (manual, auto)NomanualLấy prompt nhiệm vụ từ đâu
taskstringNo-Nhiệm vụ cho agent hoàn thành. Sử dụng {{input}} để tham chiếu dữ liệu upstream.
prompt_pathstringNo{<!-- -->{input}<!-- -->}Đường dẫn để trích xuất prompt từ đầu vào (ví dụ: {{input.message}})
join_strategyselect (first, newline, separator, json)NofirstCách xử lý đầu vào mảng
join_separatorstringNo`

| Ký tự phân cách để nối các mục mảng | |max_input_size| number | No |10000| Số ký tự tối đa cho prompt (ngăn tràn) | |system_prompt| string | No |You are a helpful AI agent. Use the available tools to complete the task. Think step by step.| Hướng dẫn cho hành vi agent | |tools| array | No |[]| Danh sách ID module (thay thế cho kết nối các node công cụ) | |context| object | No |{}| Danh sách ID module (thay thế cho kết nối các node công cụ) | |max_iterations| number | No |10| Dữ liệu ngữ cảnh bổ sung cho agent | |provider | select (openai, anthropic, ollama) | No | openai| AI model provider | |model| string | No |gpt-4o| Specific model to use | |temperature| number | No |0.3| Creativity level (0=deterministic, 1=creative) | |api_key| string | No | - | API key (defaults to provider env var) | |base_url` | string | No | - | Custom API base URL (for Ollama or proxies) |

Output:

FieldTypeDescription
okbooleanAgent có hoàn thành thành công không
resultstringAgent có hoàn thành thành công không
stepsarrayAgent có hoàn thành thành công không
tool_callsnumberKết quả cuối cùng từ agent
tokens_usednumberDanh sách các bước agent đã thực hiện

Example: Web Research Agent

yaml
task: Search for the latest news about AI and summarize the top 3 stories
tools: ["http.request", "data.json_parse"]
model: gpt-4o

Example: Data Processing Agent

yaml
task: Read the CSV file, filter rows where status is "active", and count them
tools: ["file.read", "data.csv_parse", "array.filter"]
model: gpt-4o

Released under the Apache 2.0 License.