llama-index-tools-ejentum
LlamaIndex tool spec that subclasses McpToolSpec and points at the hosted Ejentum MCP server. Exposes the eight cognitive-harness tools as LlamaIndex FunctionTool objects ready for any LlamaIndex agent or query engine.
Use the harness before the agent generates on complex, multi-step, or multi-constraint tasks where the model's default reasoning template would miss a constraint, take a shortcut, or drift across turns. Each call returns a cognitive operation: a structured procedure (numbered steps with a failure pattern to refuse and a falsification test) paired with an executable reasoning topology (a DAG of those steps with decision gates, parallel branches, bounded loops, and meta-cognitive exit nodes). The agent reads both layers before producing its response.
Four dynamic tools (reasoning, code, anti-deception, memory) are available on all tiers including the 30-day free trial. Four adaptive tools (adaptive-reasoning, adaptive-code, adaptive-anti-deception, adaptive-memory) additionally run an adapter LLM that rewrites the matched operation with task-specific identifiers; they require the Go or Super tier.
Tool names exposed to the LLM are whatever the upstream MCP server advertises (canonical hyphenated strings: reasoning, code, anti-deception, memory, adaptive-reasoning, adaptive-code, adaptive-anti-deception, adaptive-memory). This shim does not rename them.
Install
pip install llama-index-tools-ejentum
Configuration
export EJENTUM_API_KEY="ej_..."
Or pass api_key= to EjentumToolSpec(...). Get a key at ejentum.com/pricing.
Usage
Minimal
from llama_index.tools.ejentum import EjentumToolSpec
spec = EjentumToolSpec()
tools = spec.to_tool_list()
Subset of modes
spec = EjentumToolSpec(modes=["reasoning", "code", "adaptive-reasoning", "adaptive-code"])
tools = spec.to_tool_list()
Valid mode names (use canonical hyphenated form): reasoning, code, anti-deception, memory, adaptive-reasoning, adaptive-code, adaptive-anti-deception, adaptive-memory.
With a ReActAgent
from llama_index.core.agent import ReActAgent
from llama_index.llms.openai import OpenAI
from llama_index.tools.ejentum import EjentumToolSpec
tools = EjentumToolSpec().to_tool_list()
agent = ReActAgent.from_tools(tools, llm=OpenAI(model="gpt-4o-mini"))
response = await agent.achat(
"Why might our microservice return 503s only under specific load patterns?"
)
Tool inventory
Dynamic (all tiers)
| Tool | Library size |
|---|---|
reasoning |
311 |
code |
128 |
anti-deception |
139 |
memory |
101 |
Adaptive (Go or Super tier)
| Tool |
|---|
adaptive-reasoning |
adaptive-code |
adaptive-anti-deception |
adaptive-memory |
Each tool takes a single query: str argument. Returns the injection as a string.
API reference
EjentumToolSpec(
api_key: str | None = None,
modes: list[str] | None = None,
api_url: str = "https://api.ejentum.com/mcp",
timeout: int = 30,
)
| Field | Default | Description |
|---|---|---|
api_key |
None |
If unset, read from EJENTUM_API_KEY. Raises ValueError at construction if neither is set. |
modes |
None |
Optional subset of harness modes to expose. Defaults to all eight. |
api_url |
https://api.ejentum.com/mcp |
Override for self-hosted MCP gateway. |
timeout |
30 |
HTTP timeout in seconds for the underlying MCP client. |
The class is a thin subclass of llama_index.tools.mcp.McpToolSpec, pre-configured with the hosted Ejentum endpoint and Bearer authentication.
Wire contract
This shim talks to the MCP endpoint (/mcp), not the direct-REST endpoint (/harness/). For the direct-REST contract used by every other Ejentum shim, see the ejentum-mcp README; for the MCP-over-streamable-HTTP contract, see the MCP specification.
Field structure of an injection and a canonical dynamic-vs-adaptive comparison on the same query are documented in the ejentum-mcp README.
The underlying MCP server
The same MCP server is available on three additional surfaces:
- Stdio via
npx -y ejentum-mcp - Hosted Streamable HTTP at
https://api.ejentum.com/mcp - Listed on the Official MCP Registry as
io.github.ejentum/ejentum-mcp
Compatibility
- Python 3.10+
llama-index-core>=0.13.0,<0.15llama-index-tools-mcp>=0.4.1,<0.5
License
Measured effects
The Ejentum harness is benchmarked publicly under CC BY 4.0 at github.com/ejentum/benchmarks:
- ELEPHANT sycophancy: 5.8% composite on GPT-4o (40 real Reddit scenarios)
- LiveCodeBench Hard: 85.7% to 100% on Claude Opus (28 competitive programming tasks)
- Memory retention: 50% fewer stale facts served (20-turn implicit state changes)
- Plus per-harness numbers across BBH/CausalBench/MuSR, ARC-AGI-3, SciCode, and perception tasks
Methodology, scenarios, run scripts, and raw outputs are all in-repo.
Metadata
Release files for llama-index-tools-ejentum 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| llama_index_tools_ejentum-0.2.0.tar.gz | 7.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| llama_index_tools_ejentum-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.8 kB
Release files / llama_index_tools_ejentum-0.2.0.tar.gz
| Download URL | llama_index_tools_ejentum-0.2.0.tar.gz |
|---|---|
| Size | 7.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a1e16217a434a8c01d5db9e154be3ab6681a479a27d69e89cf82fae9930b4743
|
|
BLAKE2b-256 checksum How to use checksums |
9cbb0e137663cac8fdaf53a190a500c1e074f34532d57f3b20c2401dbae66c15
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Release files / llama_index_tools_ejentum-0.2.0-py3-none-any.whl
| Download URL | llama_index_tools_ejentum-0.2.0-py3-none-any.whl |
|---|---|
| Size | 6.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2672f95739210ca454e0ff68871daa305d32a1f54aeab040da8b3d38e48e91d6
|
|
BLAKE2b-256 checksum How to use checksums |
529d3eb566502b8e311c6f4be8976e2067bdf92493c4a0fb2d39f4f0098937c9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|