@f8synapse/nodes-ai
v0.1.0
Published
AI/ML workflow nodes — LLM completion, LangChain, agent loops, and vector search.
Readme
@f8synapse/nodes-ai
AI/ML workflow nodes — LLM completion, LangChain, agent loops, and vector search.
Installation
npm install @f8synapse/nodes-ai
# or
pnpm add @f8synapse/nodes-aiUsage
import { createWorkflowEngine } from '@f8synapse/engine';
import { createConfiguredNodeRegistry } from '@f8synapse/nodes-core';
import { registerAiNodes } from '@f8synapse/nodes-ai';
// Start with core nodes, then layer in AI nodes
const registry = createConfiguredNodeRegistry();
registerAiNodes(registry);
const engine = createWorkflowEngine({
nodeRegistry: registry,
// Secrets adapter supplies OPENAI_API_KEY, ANTHROPIC_API_KEY, etc.
});
const execution = await engine.executeWorkflow({
id: 'wf-ai-001',
name: 'LLM Summarizer',
nodes: [
{
id: 'n1',
type: 'llm',
config: {
provider: 'openai',
model: 'gpt-4o',
prompt: 'Summarize: {{input.text}}',
},
},
{ id: 'n2', type: 'end', config: {} },
],
edges: [{ from: 'n1', to: 'n2' }],
});API
Functions
| Export | Description |
| -------------------------------- | ---------------------------------------------------------- |
| registerAiNodes | Registers all AI nodes into an existing NodeRegistry |
| createConfiguredAiNodeRegistry | Creates a new NodeRegistry pre-loaded with AI nodes only |
Node Classes (selective imports)
| Node Class | Type Key | Description |
| ------------------ | --------------- | -------------------------------------------------------------- |
| LlmNode | llm | Generic LLM completion via engine provider registry |
| AiCompletionNode | ai_completion | Direct AI completion with structured output support |
| LangChainNode | langchain | Executes LangChain chains and pipelines |
| AgentNode | agent | Autonomous agent loop with tool use |
| VectorSearchNode | vector_search | Semantic similarity search via Pinecone or other vector stores |
License
MIT
