Build Your Own Coding Agent
Create an AI coding assistant that can read your codebase, make edits, run tests, and iterate until the code works — deployed as an OpenAI-compatible API endpoint.
Deploy in one click: AI Coding Agent Template
An AI agent that:
- Receives a coding task via HTTP API
- Reads relevant source files
- Makes targeted code edits (find-and-replace)
- Runs tests or builds to verify
- Iterates if tests fail
- Streams the final response back
- Tensorify CLI installed and running (
tensorify runner start) - An OpenAI or Anthropic API key
- A Tavily API key (for web search, optional)
- A project directory on your machine
POST /coding-agent → API Trigger → AI Agent → Return (SSE stream)
├── File Ops (read/write/replace)
├── Shell (run tests, git)
├── System Info (check processes)
└── Web Search (lookup docs)
└── Window Memory (conversation)
Create from Template
Go to Templates → "AI Coding Agent" → Create. This gives you the full workflow pre-wired.
Configure Secrets
In workspace Settings → Env Vars, add:
OPENAI_API_KEY— your OpenAI key (orANTHROPIC_API_KEYif using Claude)SEARCH_API_KEY— Tavily key for web search (optional)
Set the Working Directory
In the Shell node settings, set working_directory to your project path:
/home/you/projects/my-app
This is where the agent will run commands from.
Configure Agent Permissions
In the File Ops node, set allowed_operations to control what the agent can do:
- Safe:
["read", "list", "replace"]— can read and make targeted edits - Full: all operations — can create/delete files too
Deploy in CLI Mode
Select "Self-Hosted" in the execution target, then click Deploy. The workflow runs on your machine with full filesystem access.
Test with curl
curl -N -X POST https://triggers.tensorify.io/{team}/{path} \
-H "Content-Type: application/json" \
-d '{"message": "Fix the failing test in src/auth.test.ts"}'
The -N flag enables streaming — you'll see the agent's reasoning in real-time.
The API Trigger with protocol: "openai-chat" makes your agent compatible with any OpenAI client:
from openai import OpenAI
client = OpenAI(
base_url="https://triggers.tensorify.io/{team}/{path}",
api_key="not-needed" # auth handled by Tensorify
)
response = client.chat.completions.create(
model="coding-agent",
messages=[{"role": "user", "content": "Add error handling to the login function"}],
stream=True
)
for chunk in response:
print(chunk.choices[0].delta.content or "", end="")
The AI Agent uses a ReAct loop (Reason → Act → Observe):
- Reason: "I need to read the test file to understand the failure"
- Act: Calls
file_ops({ operation: "read", path: "src/auth.test.ts" }) - Observe: Sees the file contents, identifies the bug
- Reason: "The test expects a different return type. I'll fix the implementation."
- Act: Calls
file_ops({ operation: "replace", path: "src/auth.ts", find: "...", replace_with: "..." }) - Act: Calls
shell({ operation: "exec", command: "npm test src/auth.test.ts" }) - Observe: Tests pass!
- Respond: "Fixed the auth function — the test was expecting an object but got a string..."
- Model choice: Use GPT-4o or Claude Sonnet for complex coding tasks; GPT-4o-mini for simple fixes
- Max iterations: Set to 15+ for complex multi-file changes
- Temperature: Keep low (0.1–0.3) for deterministic code edits
- System prompt: Be specific about your codebase (language, framework, test runner)
- find-and-replace: More reliable than full file rewrites for targeted edits
- Conversation memory: Persists across requests, so the agent remembers your codebase context
- Connect to Slack or Telegram for chat-based coding assistance
- Add GitHub plugin to automatically create PRs with fixes
- Set up a dedicated project directory for the agent to work in
