This is a custom n8n node for integrating the AI Search API into your automation workflows.
It brings semantic search, context awareness, and balance monitoring directly into your n8n pipelines.
πŸ‘‰ Get started now:

Features

  • πŸ” Intelligent Semantic Search – Natural language queries with embeddings
  • πŸ’¬ Context Management – Add previous messages for richer answers
  • πŸ“ Flexible Responses – Markdown or plain text output
  • πŸ“Š Balance Monitoring – Track credits and usage in real time
  • ⚑ TypeScript Support – Strong typings and IDE hints
  • 🧩 n8n Ready – Works as a drag-and-drop node inside your n8n editor

Installation

npm install n8n-nodes-aisearchapi

From source

git clone https://github.com/aisearchapi/aisearchapi-n8n.git
cd aisearchapi-n8n
npm install
npm run build

Run n8n with Your Extension

Windows PowerShell (edit the path)

docker run -it --rm -p 5678:5678 `
  -e N8N_CUSTOM_EXTENSIONS=/extensions `
  -e N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true `
  -e DB_SQLITE_POOL_SIZE=5 `
  -e N8N_RUNNERS_ENABLED=true `
  -v "C:\n8n-extensions\aisearchapi-n8n:/extensions" `
  -v n8n_data:/home/node/.n8n `
  n8nio/n8n:latest

macOS / Linux / WSL (edit the path)

docker run -it --rm -p 5678:5678   -e N8N_CUSTOM_EXTENSIONS=/extensions   -e N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true   -e DB_SQLITE_POOL_SIZE=5   -e N8N_RUNNERS_ENABLED=true   -v "$HOME/n8n-extensions/aisearchapi-n8n:/extensions"   -v n8n_data:/home/node/.n8n   n8nio/n8n:latest
Then open: http://localhost:5678
You should see: Loaded extensions from /extensions

Configuration in n8n

  1. Go to Credentials β†’ New β†’ AI Search API
  2. Paste your API Key (without the Bearer prefix)
  3. Save credentials

Usage

  • Resource: Search
  • Operation: Search
  • Parameters:
    • query β†’ your question (required)
    • responseType β†’ markdown | text
    • context β†’ optional array of messages
    • timeout β†’ ms (default 30000)

Balance

  • Resource: Account
  • Operation: Get Balance

Error Codes

CodeMeaningFix
401UnauthorizedInvalid key β†’ Get a new key
429Too Many RequestsSlow down / add retry logic
433Quota ExceededBuy credits / upgrade
500Server ErrorTry again later
503Service DownTemporary downtime

Development

git clone https://github.com/aisearchapi/aisearchapi-n8n.git
cd aisearchapi-n8n
npm install
npm run build
You should see compiled files:
  • dist/credentials/AiSearchApi.credentials.js
  • dist/nodes/AiSearchApi/AiSearchApi.node.js
package.json important parts:
{
  "name": "n8n-nodes-aisearchapi",
  "version": "0.1.0",
  "main": "dist/index.js",
  "files": ["dist", "README.md", "LICENSE"],
  "keywords": ["n8n", "n8n-community-node-package", "AI Search API", "semantic search", "automation"],
  "n8n": {
    "nodes": ["dist/nodes/AiSearchApi/AiSearchApi.node.js"],
    "credentials": ["dist/credentials/AiSearchApi.credentials.js"]
  }
}

TypeScript Config

CommonJS build to avoid ESM issues:
{
  "compilerOptions": {
    "target": "ES2020",
    "module": "CommonJS",
    "moduleResolution": "Node",
    "lib": ["ES2020"],
    "outDir": "./dist",
    "rootDir": ".",
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "forceConsistentCasingInFileNames": true,
    "declaration": true,
    "declarationMap": true,
    "sourceMap": true,
    "allowSyntheticDefaultImports": true,
    "resolveJsonModule": true
  },
  "include": ["credentials/**/*", "nodes/**/*"],
  "exclude": ["node_modules", "dist", "**/*.spec.ts"]
}

Logos / Icons

Put your SVGs in:
  • nodes/AiSearchApi/aisearchapi.svg
  • credentials/aisearchapi.svg
Build script copies them next to compiled files in dist/...

Best Practices

  • Keep your API key secret (use n8n Credentials)
  • Use Markdown output for rich UI
  • Reset context when changing topics
  • Watch your credits with the balance endpoint

Troubleshooting

  • Node not visible in n8n β†’ Check build files exist, restart Docker, verify mounted path
  • Cannot find package β€˜n8n-workflow’ β†’ Install it: npm i n8n-workflow@1.108.2
  • Build issues on Windows β†’ Use shx for copy operations instead of cp

Resources


Start Now

Install and connect your API key in n8n, then start building AI-powered workflows:
npm install n8n-nodes-aisearchapi