AI research agent with OpenAI function calling for n8n. Port of sgr-deep-research Python project.
Copyright (C) 2025 MiXaiLL76 ([email protected])
n8n is a fair-code licensed workflow automation platform.
Follow the installation guide in the n8n community nodes documentation.
If you have version 0.1.2 or earlier installed, you need to manually remove it before installing the new version:
- Uninstall the old package from n8n Community Nodes settings
- Restart n8n to ensure the old package is completely removed
- Install the new version from npm or GitHub
This is required due to a fix in package structure that prevents automatic updates from 0.1.2 to 0.1.3+.
- Add SGR Agent node to your workflow
- Connect AI Language Model (OpenAI, Anthropic, etc.)
- Connect AI Tools (optional): search, MCP, LangChain tools
- Connect Memory (optional): for conversation history
Chat Trigger → SGR Agent → Output
↓ ↓ ↓ ↓
[Model][Tools][Memory]
Import SGR_Example.json to get started.
Agent uses 6 system tools for research tasks:
reasoning_tool- analyze task and plan next stepsfinal_answer_tool- complete task executioncreate_report_tool- generate detailed reports with citationsclarification_tool- ask clarifying questionsgenerate_plan_tool- create research plansadapt_plan_tool- adjust plans based on findings
All tools can be enabled/disabled in node settings.
Connect any n8n AI Tool:
- SGR Tavily Search - web search (included)
- MCP Client Tool - Model Context Protocol integrations
- LangChain Tools - calculators, code interpreters, etc.
- Supports the
/toolscommand to display all connected tools
Agent automatically highlights connected tools when they execute.
Connect n8n Memory node for conversation history:
- Remembers previous interactions within session
- Automatically clears when
sessionIdchanges - Supports
/clearand/newcommands - Only stores user questions and final answers (not internal reasoning)
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
Override default prompts:
- System Prompt - agent behavior instructions
- Initial User Request Template - format task presentation
- Clarification Response Template - format clarification responses
- n8n community nodes documentation
- SGR Deep Research (Original Python Project)
- n8n AI Agents Documentation
This project is licensed under AGPL-3.0 - see the LICENSE file for details.
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]
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.
