crewai-ejentum
CrewAI tool for the Ejentum Reasoning Harness. Exposes a single EjentumHarnessTool class with a mode parameter covering eight values: four dynamic (reasoning, code, anti-deception, memory) and four adaptive (adaptive-reasoning, adaptive-code, adaptive-anti-deception, adaptive-memory).
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.
Dynamic modes return the top-1 abstract operation from the matching library; adaptive modes additionally run an adapter LLM that rewrites the operation with task-specific identifiers. Adaptive modes require the Go or Super tier.
Install
pip install crewai-ejentum
Configuration
export EJENTUM_API_KEY="ej_..."
EJENTUM_API_KEY is read from the environment at call time. Get a key at ejentum.com/pricing.
Usage
from crewai import Agent, Task, Crew
from crewai_ejentum import EjentumHarnessTool
harness = EjentumHarnessTool()
architect = Agent(
role="Senior architect",
goal="Evaluate technical decisions honestly",
backstory="Pragmatic; pushes back on sunk-cost framings.",
tools=[harness],
)
task = Task(
description=(
"We have spent three months on the GraphQL gateway. It's mostly done. "
"Should we keep going or pivot to REST? "
"Call the Ejentum harness with mode='anti-deception' first."
),
agent=architect,
expected_output="A recommendation that separates past spending from prospective evaluation.",
)
Crew(agents=[architect], tasks=[task]).kickoff()
Modes
| Mode | Library size | Domain |
|---|---|---|
reasoning |
311 | abstraction, time, causality, simulation, spatial, metacognition |
code |
128 | software-engineering layer |
anti-deception |
139 | sycophancy, hallucination, deception, adversarial framing, judgment, executive control |
memory |
101 | perception layer (filter-oriented; not for fact extraction) |
adaptive-reasoning |
311 (same pool) | with adapter LLM rewriting procedure + topology for the specific task |
adaptive-code |
128 | same as above for code |
adaptive-anti-deception |
139 | same as above for anti-deception |
adaptive-memory |
101 | same as above for memory |
Inputs
EjentumHarnessTool._run accepts:
query(string, required): a 1-2 sentence description of the task. Formode="memory"or"adaptive-memory", use the format"I noticed X. This might mean Y. Sharpen: Z.".mode(string, required): one of the eight mode strings above.
Returns the injection as a string. Errors return as human-readable strings; the tool does not raise, so an agent step never crashes the run.
API reference
EjentumHarnessTool(
api_url: str = "https://api.ejentum.com/harness/",
timeout_seconds: float = 10.0,
)
| Field | Default | Description |
|---|---|---|
api_url |
https://api.ejentum.com/harness/ |
Override for self-hosted gateway. |
timeout_seconds |
10.0 |
Per-call HTTP timeout. |
Wire contract
POST https://api.ejentum.com/harness/
Headers: Authorization: Bearer <key>, Content-Type: application/json
Body: { "query": <string>, "mode": <one of 8 mode strings> }
Response (200): [ { "<mode>": "<injection string>" } ]
Response (401|403|429): { "error": "..." }
Full wire contract, field structure of an injection, DAG syntax, and a canonical dynamic-vs-adaptive comparison on the same query are documented in the ejentum-mcp README.
ejentum-mcp alternative
The same eight modes are exposed as MCP tools at https://api.ejentum.com/mcp. If you prefer that route, CrewAI's MCP support can consume the hosted endpoint with Bearer auth.
Compatibility
- Python 3.10+
crewai>=0.40.0requests>=2.31.0
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 crewai-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 | |
|---|---|---|---|
| crewai_ejentum-0.2.0.tar.gz | 8.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| crewai_ejentum-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.6 kB
Release files / crewai_ejentum-0.2.0.tar.gz
| Download URL | crewai_ejentum-0.2.0.tar.gz |
|---|---|
| Size | 8.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d992155f3dbe625c72bc5fe28faa2bbc83e1af2e83cc2711e108603055db7594
|
|
BLAKE2b-256 checksum How to use checksums |
f575a7575456fb18d59ba7513e7b83242809e76b613789b25fdd5dd2ca3ed7a1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Release files / crewai_ejentum-0.2.0-py3-none-any.whl
| Download URL | crewai_ejentum-0.2.0-py3-none-any.whl |
|---|---|
| Size | 8.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
11e9a987ea46f6b2226c04056b2193a48237da6861e6b6bb16935a7d4ed6b99a
|
|
BLAKE2b-256 checksum How to use checksums |
69fb29f0dd3e37c1604415ec19d782568bebec60eb61f6449cbc530daac70a87
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|