npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

n8n-nodes-sgr-tool-calling

v0.1.11

Published

n8n node for SGR AI Agent with Tool Calling capabilities and Tavily Search integration

Readme

n8n-nodes-sgr-tool-calling

SGR Example

AI research agent with OpenAI function calling for n8n. Port of sgr-agent-core Python project.

Copyright (C) 2025 MiXaiLL76 ([email protected])

n8n is a fair-code licensed workflow automation platform.

Installation

Follow the installation guide in the n8n community nodes documentation.

Quick Start

  1. Add SGR Agent node to your workflow
  2. Connect AI Language Model (OpenAI, Anthropic, etc.)
  3. Connect AI Tools (optional): search, MCP, LangChain tools
  4. Connect Memory (optional): for conversation history

Example Workflow

Chat Trigger → SGR Agent → Output
              ↓ ↓ ↓ ↓
        [Model][Tools][Memory]

Import SGR_Example.json to get started.

Features

Built-in Tools

Agent uses 6 system tools for research tasks:

  • reasoning_tool - analyze task and plan next steps
  • final_answer_tool - complete task execution
  • create_report_tool - generate detailed reports with citations
  • clarification_tool - ask clarifying questions
  • generate_plan_tool - create research plans
  • adapt_plan_tool - adjust plans based on findings

All tools can be enabled/disabled in node settings.

Connected Tools

Connect any n8n AI Tool:

  • SGR Tavily Search - web search (included)
  • SGR Custom Final Answer Tool - customizable final answer schema (included)
  • MCP Client Tool - Model Context Protocol integrations
  • LangChain Tools - calculators, code interpreters, etc.
  • Supports the /tools command to display all connected tools

Agent automatically highlights connected tools when they execute.

SGR Custom Final Answer Tool

Allows you to customize the JSON schema for the final answer tool:

  • Define your own schema structure using JSON Schema format
  • Default schema imported from nodes/SGR/tools/finalAnswer.ts
  • Automatically disables built-in Final Answer and Clarification tools when connected
  • Built-in schema validation ensures proper format
  • Supports both full JSON return or field extraction
  • Perfect for custom report formats with specific fields like citations, confidence scores, metadata, etc.

Memory

Connect n8n Memory node for conversation history:

  • Remembers previous interactions within session
  • Automatically clears when sessionId changes
  • Supports /clear and /new commands
  • Only stores user questions and final answers (not internal reasoning)
  • Clarification Support: preserves conversation context when agent requests clarifications

Clarification Flow

When agent needs clarification, it uses the clarification_tool to ask questions:

  1. Agent Requests Clarification

    • Agent analyzes the task and identifies ambiguous terms
    • Calls clarification_tool with 3 specific questions
    • Conversation history (including questions) is saved to Memory
    • Execution pauses with state WAITING_FOR_CLARIFICATION
  2. User Provides Answers

    • Send answers via clarificationAnswers field in input
    • Agent loads conversation history from Memory
    • Continues research with full context

Limits

Configure resource constraints:

  • Max Iterations (default: 10) - reasoning cycles before stopping
  • Max Searches (default: 4) - web search limit
  • Max Clarifications (default: 3) - clarification request limit

Custom Prompts

Override default prompts:

  • System Prompt - agent behavior instructions
  • Initial User Request Template - format task presentation
  • Clarification Response Template - format clarification responses

Resources

License

This project is licensed under AGPL-3.0 - see the LICENSE file for details.

Commercial Licensing

AGPL-3.0 requires you to open-source your modifications and provide source code to users if you run this software as a network service.

For commercial use where you want to:

  • Keep your modifications private
  • Integrate into proprietary software
  • Provide as a managed service without open-sourcing

Contact for a commercial license: [email protected]

Free Use Cases

This software is free for:

  • ✅ Personal use
  • ✅ Educational purposes
  • ✅ Research projects
  • ✅ Open-source projects (compliant with AGPL-3.0)

If you modify and deploy this software as a network service, you must provide source code to your users under AGPL-3.0 terms.