{"id":50449748,"url":"https://github.com/ejentum/ejentum-genkit","last_synced_at":"2026-06-02T23:00:33.731Z","repository":{"id":361454069,"uuid":"1247091095","full_name":"ejentum/ejentum-genkit","owner":"ejentum","description":"Genkit integration for the Ejentum Reasoning Harness. createEjentumTools(ai) registers 8 agent-callable tools (4 harnesses Ã— dynamic + adaptive).","archived":false,"fork":false,"pushed_at":"2026-05-30T17:37:12.000Z","size":90,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-30T19:10:03.031Z","etag":null,"topics":["agentic-ai","ai","anti-deception","cognitive-scaffold","ejentum","firebase","genkit","google-genkit","llm","reasoning-harness","typescript"],"latest_commit_sha":null,"homepage":"https://ejentum.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ejentum.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-22T22:26:56.000Z","updated_at":"2026-05-30T17:18:26.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ejentum/ejentum-genkit","commit_stats":null,"previous_names":["ejentum/ejentum-genkit"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ejentum/ejentum-genkit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ejentum%2Fejentum-genkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ejentum%2Fejentum-genkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ejentum%2Fejentum-genkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ejentum%2Fejentum-genkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ejentum","download_url":"https://codeload.github.com/ejentum/ejentum-genkit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ejentum%2Fejentum-genkit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33840214,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-02T02:00:07.132Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agentic-ai","ai","anti-deception","cognitive-scaffold","ejentum","firebase","genkit","google-genkit","llm","reasoning-harness","typescript"],"created_at":"2026-06-01T00:00:27.157Z","updated_at":"2026-06-02T23:00:33.722Z","avatar_url":"https://github.com/ejentum.png","language":"TypeScript","funding_links":[],"categories":["Plugins"],"sub_categories":["JavaScript - Community"],"readme":"# ejentum-genkit\n\n[Genkit](https://genkit.dev) integration for the Ejentum Reasoning Harness. `createEjentumTools(ai)` registers eight tools against your `genkit()` instance and returns them as a `ToolAction[]` you pass to `ai.generate({ tools })` or `ai.chat({ tools })`.\n\nUse 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.\n\nFour 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.\n\n## Install\n\n```bash\nnpm install ejentum-genkit\n# peer dep\nnpm install genkit\n```\n\n## Configuration\n\n```bash\nexport EJENTUM_API_KEY=\"ej_...\"\n```\n\nOr pass it explicitly: `createEjentumTools(ai, { apiKey: \"...\" })`. Get a key at [ejentum.com/pricing](https://ejentum.com/pricing).\n\n## Usage\n\n```ts\nimport { genkit } from \"genkit\";\nimport { gemini20Flash, googleAI } from \"@genkit-ai/googleai\";\nimport { createEjentumTools } from \"ejentum-genkit\";\n\nconst ai = genkit({ plugins: [googleAI()], model: gemini20Flash });\nconst tools = createEjentumTools(ai);\n\nconst response = await ai.generate({\n  prompt: \"Should we keep the GraphQL gateway or pivot to REST?\",\n  tools,\n});\n```\n\n### Chat interface\n\n```ts\nconst chat = ai.chat({ tools: createEjentumTools(ai) });\nconst response = await chat.send(\"Why does our nightly ETL fail intermittently?\");\n```\n\n### Pick a subset\n\n```ts\nimport { createReasoningTool, createAntiDeceptionTool } from \"ejentum-genkit\";\n\nconst tools = [createReasoningTool(ai), createAntiDeceptionTool(ai)];\n```\n\n## Tool inventory\n\nThe LLM-facing tool name is the `name` field passed to `ai.defineTool` (canonical hyphenated strings).\n\n| Factory | Tool `name` (LLM-visible) | Mode string | Library size |\n|---|---|---|---:|\n| `createReasoningTool` | `reasoning` | `reasoning` | 311 |\n| `createCodeTool` | `code` | `code` | 128 |\n| `createAntiDeceptionTool` | `anti-deception` | `anti-deception` | 139 |\n| `createMemoryTool` | `memory` | `memory` | 101 |\n| `createAdaptiveReasoningTool` | `adaptive-reasoning` | `adaptive-reasoning` | (same pool) |\n| `createAdaptiveCodeTool` | `adaptive-code` | `adaptive-code` | (same pool) |\n| `createAdaptiveAntiDeceptionTool` | `adaptive-anti-deception` | `adaptive-anti-deception` | (same pool) |\n| `createAdaptiveMemoryTool` | `adaptive-memory` | `adaptive-memory` | (same pool) |\n\nEach tool takes one parameter, `query: string`, and returns the injection as plain text. Errors return as strings rather than thrown exceptions.\n\n## API reference\n\n```ts\nimport { createEjentumTools, type EjentumConfig, type HarnessMode } from \"ejentum-genkit\";\nimport { Genkit, ToolAction } from \"genkit\";\n\ncreateEjentumTools(ai: Genkit, config?: EjentumConfig): ToolAction[]\n```\n\n| `EjentumConfig` field | Default | Description |\n|---|---|---|\n| `apiKey` | `process.env.EJENTUM_API_KEY` | API key. |\n| `apiUrl` | `https://api.ejentum.com/harness/` | Override for self-hosted gateway. |\n| `timeoutMs` | `10000` | Per-call HTTP timeout. |\n\nPer-tool factories: `createReasoningTool(ai, config)`, `createCodeTool(ai, config)`, `createAntiDeceptionTool(ai, config)`, `createMemoryTool(ai, config)`, plus the four `createAdaptive*Tool(ai, config)` variants. Each accepts the caller's `Genkit` instance plus an optional `EjentumConfig`.\n\n## Why the `ai` argument\n\nGenkit's `defineTool` is an instance method on the `genkit()` object, not a free function. The factory therefore accepts the caller's `ai` instance and registers all eight tools against it. The returned `ToolAction[]` is a standard array consumable by `ai.generate({ tools })` and `ai.chat({ tools })`.\n\n## Wire contract\n\n`createEjentumTools(ai)` issues:\n\n```\nPOST https://api.ejentum.com/harness/\nHeaders: Authorization: Bearer \u003ckey\u003e, Content-Type: application/json\nBody:    { \"query\": \u003cstring\u003e, \"mode\": \u003cone of 8 mode strings\u003e }\nResponse (200): [ { \"\u003cmode\u003e\": \"\u003cinjection string\u003e\" } ]\n```\n\nFull wire contract, field structure, DAG syntax, and a canonical dynamic-vs-adaptive comparison on the same query are documented in the [ejentum-mcp README](https://github.com/ejentum/ejentum-mcp#wire-contract). The format is identical across this package and every Ejentum shim.\n\n## ejentum-mcp alternative\n\nGenkit supports MCP via the `@genkit-ai/mcp` plugin:\n\n```ts\nimport { mcpClient } from \"@genkit-ai/mcp\";\n\nconst ejentumPlugin = mcpClient({\n  name: \"ejentum\",\n  serverProcess: { command: \"npx\", args: [\"-y\", \"ejentum-mcp\"] },\n});\nconst ai = genkit({ plugins: [ejentumPlugin] });\n```\n\n## Compatibility\n\n- Node.js 18+\n- `genkit` 1.x (peer dep `\u003e=1.0.0`)\n- TypeScript 5.x\n- `zod` is re-exported from `genkit`; no separate install\n\n## License\n\n[MIT](./LICENSE)\n\n\n## Measured effects\n\nThe Ejentum harness is benchmarked publicly under CC BY 4.0 at [github.com/ejentum/benchmarks](https://github.com/ejentum/benchmarks):\n\n- **ELEPHANT** sycophancy: 5.8% composite on GPT-4o (40 real Reddit scenarios)\n- **LiveCodeBench Hard**: 85.7% to 100% on Claude Opus (28 competitive programming tasks)\n- **Memory retention**: 50% fewer stale facts served (20-turn implicit state changes)\n- Plus per-harness numbers across BBH/CausalBench/MuSR, ARC-AGI-3, SciCode, and perception tasks\n\nMethodology, scenarios, run scripts, and raw outputs are all in-repo.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fejentum%2Fejentum-genkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fejentum%2Fejentum-genkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fejentum%2Fejentum-genkit/lists"}