Integrations
Ejentum is a single POST endpoint returning JSON. Any system that can make an HTTP request and inject text into a prompt works with the Logic API. No SDK required. No dependencies.
Choose your path: MCP server (one-click) · No code (n8n) · Multi-agent no-code (Heym) · Python (LangChain) · Multi-agent (CrewAI) · Claude (Agent SDK) · IDE (Cursor/Windsurf) · Make.com · Any framework
For endpoint details, see the API Reference. For real injection payloads, see Examples.
The Injection Principle
Where you inject matters as much as what you inject.
1. Inject BEFORE the task, not after. The injection must be the first structured content the model processes. LLMs attend most strongly to content at the beginning of context.
2. Inject into the SYSTEM message, not the user message. The system message sets the model's operational mode. Injecting into the user message treats the injection as data to reason about, not as a constraint to follow.
3. Keep the injection SEPARATE from your instructions.
The [REASONING CONTEXT]...[END REASONING CONTEXT] delimiters create a distinct attention block. Do not merge the injection into natural language instructions.
4. Re-inject per turn in multi-turn agents. Injections degrade over long contexts. Call the API for each new task step and inject fresh. Injections act as persistent attention anchors, but they lose effectiveness as task-specific tokens accumulate over extended chains. Re-injection maintains the effect.
MCP server
The fastest path. One install, works across Claude Desktop, Cursor, Windsurf, Claude Code, n8n's MCP Client node, and any other MCP-compatible client. The four cognitive harnesses appear as harness_* tools your agent can call.
Two install paths for the same four
harness_*tools. Hosted HTTPS (HTTP-MCP clients):https://api.ejentum.com/mcpwithAuthorization: Bearer YOUR_EJENTUM_API_KEY. No install, no subprocess. Stdio (subprocess-spawning clients): theejentum-mcpnpm package vianpx -y ejentum-mcp. Source on GitHub (MIT). Also listed on Glama, mcp.so, and the Official MCP Registry.
Hosted endpoint (recommended for n8n MCP Client and any HTTP-MCP agent)
Point your client at https://api.ejentum.com/mcp. Set the Authorization header to Bearer <YOUR_EJENTUM_API_KEY>. No local install, no subprocess to manage, automatic updates as we ship new operations to the backend.
Stdio install (Claude Desktop, Cursor, Windsurf, Claude Code, Cline, Continue)
Add the ejentum-mcp npm package to your client's MCP config:
{ "mcpServers": { "ejentum": { "command": "npx", "args": ["-y", "ejentum-mcp"], "env": { "EJENTUM_API_KEY": "your_key" } } } }
Tools
| Tool | Use for |
|---|---|
harness_reasoning | Multi-step analysis, planning, diagnostics, cross-domain synthesis |
harness_code | Code generation, refactoring, review, debugging |
harness_anti_deception | Sycophancy pressure, hallucination risk, manipulation pressure |
harness_memory | Perception sharpening, drift detection, cross-turn pattern recognition |
The MCP server is a thin wrapper over the same Logic API the rest of this guide describes. For richer autonomous routing per task, install the skill files alongside the MCP server: the skill files give Claude system-level context about when to call each harness, while the MCP server fires reliably on explicit invocation.
n8n
The fastest path to testing Ejentum without writing code.
Full walkthrough with screenshots: n8n: Drop Ejentum Into Any AI Agent. Start there if you're a no-code builder.
Pattern
Add an AI Agent node to your workflow. Connect an HTTP Request Tool node to the agent's Tools input. The agent calls the Ejentum API as a tool during execution.
Steps
- Add an AI Agent node (Tools Agent type)
- Add an HTTP Request Tool node and connect it to the agent's Tools input
- Configure the HTTP Request Tool:
- Method: POST
- URL:
https://ejentum-main-ab125c3.zuplo.app/logicv1/ - Authentication: Header Auth with your API key
- Body:
{"query": "{task_description}", "mode": "reasoning"}
- The agent receives the injection in the tool response and uses it to guide its reasoning
The API returns a pre-rendered string. No field assembly needed.
Want to verify it on your data? The n8n eval workflow A/B tests the harness against an identical-retrieval baseline using four cross-lab blind judges. Import, swap the KB for yours, run.
Heym
Self-hosted, AI-native automation platform from heym.run with canvas node tools (any node wired into an agent's Tool input) and a native MCP client (consume external MCP servers via stdio, SSE, or Streamable HTTP). Two integration paths: HTTP-as-tool (full mode control, including -multi modes) or ejentum-mcp via the agent's MCP Connections (no canvas-side wiring; four harness_* tools appear natively).
Full dual-path walkthrough: Heym: Drop Ejentum Into an Agent. Path A (HTTP) and Path B (MCP), single agent across both, with a closing example that scales the pattern to a 4-agent adversarial code review team.
Path A: HTTP node as canvas tool
- Create a credential: type Bearer, name
EjentumLogicApi, value = your raw API key (noBearerprefix; Heym sends it asAuthorization: Bearer <token>). - Add an HTTP node with
label = ejentumLogicand acurlfield:curl -X POST "https://ejentum-main-ab125c3.zuplo.app/logicv1/" \ -H "Authorization: $credentials.EjentumLogicApi" \ -H "Content-Type: application/json" \ -d '{"query": "test", "mode": "reasoning"}' - Click the bot icon next to the
curlfield (this storesagentProvidedFields: ["curl"]). Drag a tool-edge from the HTTP node'stool-outputto the Agent'stool-input. - In the Agent's
systemInstruction, paste the cURL contract and instruct the agent to call the harness BEFORE non-trivial tasks. Agent picks the mode itself per call.
Path B: ejentum-mcp via the agent's MCP Connections
- On the Agent node, scroll to MCP Connections and click + Add MCP:
- Transport:
stdio - Command:
npx - Args (JSON array):
["-y", "ejentum-mcp"] - Env (JSON object):
{"EJENTUM_API_KEY": "your_key"} - Label:
ejentum
- Transport:
- Click Fetch tools. The four
harness_*tools list inline. The agent now has them as native tools, no cURL contract needed.
For a multi-agent application of Path A (4 agents, 3 harnesses, cross-lab models), one-click import the adversarial code review template from Heym's templates gallery.
LangChain / LangGraph
LCEL Chain Pattern
import requests from langchain_core.runnables import RunnablePassthrough from langchain_openai import ChatOpenAI from langchain_core.prompts import ChatPromptTemplate EJENTUM_URL = "https://ejentum-main-ab125c3.zuplo.app/logicv1/" EJENTUM_KEY = "YOUR_API_KEY" def get_injection(task: str, mode: str = "reasoning") -> str: try: r = requests.post( EJENTUM_URL, headers={"Authorization": f"Bearer {EJENTUM_KEY}", "Content-Type": "application/json"}, json={"query": task, "mode": mode}, timeout=2 ) r.raise_for_status() injection = r.json()[0][mode] return f"[REASONING CONTEXT]\n{injection}\n[END REASONING CONTEXT]" except Exception: return "" prompt = ChatPromptTemplate.from_messages([ ("system", "{reasoning}\n\nYou are a senior analyst."), ("human", "{task}") ]) chain = ( RunnablePassthrough.assign(reasoning=lambda x: get_injection(x["task"])) | prompt | ChatOpenAI(model="gpt-4o") ) result = chain.invoke({"task": "Why did our supply chain costs spike in Q3?"})
As a LangChain Tool
from langchain.tools import tool @tool def inject_reasoning(query: str) -> str: """Retrieve a cognitive ability for the given task.""" return get_injection(query)
CrewAI
Inject reasoning as pre-task context for each crew member.
import requests from crewai import Agent, Task, Crew injection = get_injection("Analyze root cause of production failures") analyst = Agent( role="Production Analyst", goal="Identify the root cause of system failures", backstory=f"You are a production analyst.\n\n{injection}", llm=your_llm )
For multi-agent crews, inject different abilities per agent. The root cause analyst gets a Causal ability. The timeline estimator gets a Temporal ability. The report writer gets an Abstraction ability.
Claude Code / Agent SDK
Via tool_use
tools = [{ "name": "get_ejentum_injection", "description": "Retrieve a cognitive ability for the current task", "input_schema": { "type": "object", "properties": { "query": {"type": "string", "description": "Task description"}, "mode": {"type": "string", "enum": ["reasoning", "reasoning-multi", "anti-deception", "code", "code-multi", "memory", "memory-multi"], "default": "reasoning"} }, "required": ["query"] } }]
When Claude decides to use this tool, make the POST request to the Ejentum API and return the injection as the tool result.
Agentic IDEs (Cursor, Windsurf, Antigravity, Codex)
All major agentic IDEs support custom HTTP tools natively. No wrapper needed.
- Add a custom tool definition pointing to the Ejentum POST endpoint
- The IDE's agent calls the tool when it needs reasoning augmentation
- The injection is placed into the agent's context automatically
This works identically across Cursor, Windsurf, Google Antigravity, and OpenAI Codex. Each IDE has its own tool configuration format, but the HTTP request is always the same: POST to /logicv1/ with your query and API key.
Make.com
- HTTP Module: POST to the Ejentum endpoint with your query
- Text Aggregator: Format the response into the injection template
- AI Module: Paste the formatted text into the system message input
Universal Pattern
Any framework. Any language. Three steps:
1. POST https://ejentum-main-ab125c3.zuplo.app/logicv1/
Body: {"query": "your task", "mode": "reasoning"}
Auth: Bearer YOUR_API_KEY
2. PARSE response[0][mode] (key matches mode name)
3. INJECT into system message before task prompt
Advanced Patterns
Task-Adaptive Injection
Different steps in a multi-step agent need different reasoning. Don't use one injection for the whole pipeline.
tasks = [ {"description": "Identify why production failed", "agent": analyst}, {"description": "Estimate recovery timeline", "agent": planner}, {"description": "Draft incident report", "agent": writer} ] for task in tasks: injection = get_injection(task["description"]) task["agent"].backstory = f"{task['agent'].base_backstory}\n\n{injection}"
The first task activates Causal reasoning. The second activates Temporal. The third activates Abstraction. One static injection would have forced all three agents into the same reasoning mode.
Feedback Loop: Re-inject on Failure
If the agent's output fails validation, re-query with the failure description.
result = agent.run(task) if not validate(result): correction = get_injection( f"Agent failed: {validation_error}. Retry with corrective reasoning." ) result = agent.run(task, system_override=correction)
This often triggers a Metacognitive ability (self-monitoring, contradiction detection) that was not selected on the first pass.
Graceful Degradation
Always wrap the API call with a timeout and fallback. Your agent must function if the API is unreachable.
def get_injection_safe(query: str, mode: str = "reasoning") -> str: try: r = requests.post(EJENTUM_URL, json={"query": query, "mode": mode}, headers={"Authorization": f"Bearer {EJENTUM_KEY}"}, timeout=2) r.raise_for_status() payload = r.json()[0].get(mode, "") return f"[REASONING CONTEXT]\n{payload}\n[END REASONING CONTEXT]" if payload else "" except Exception: return "" # Agent continues with native capability
Production Checklist
Before deploying:
- Wrap all API calls with timeout (2 seconds) and fallback
- Inject into system message, not user message
- Inject BEFORE task instructions, not after
- Test with representative queries from your actual pipeline (50+ tasks)
- Compare output quality with and without injection
- Re-inject per turn in multi-turn agents
- For compound reasoning: use
multimode, not multiple single calls - Log responses to debug ability routing
- Graceful degradation: agent functions if API is unreachable
See also: Use Cases for industry-specific integration patterns. Builder's Playbook for real-world workflow examples.