intelligence-engine

Injects DAG ground truth and multi-call reasoning techniques into LLM calls via shell hooks.

1|Updated Jun 17, 2026
One-click install
npx skills add https://github.com/specdog/collar --skill intelligence-engine-specdog
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: intelligence-engine
Source: https://github.com/specdog/collar/tree/main/skills/intelligence-engine
Command: npx skills add https://github.com/specdog/collar --skill intelligence-engine-specdog

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? LLM answers often hallucinate facts, ignore project-specific ground truth, and rely on single-pass generation. This Skill enforces code-level intelligence amplification by wiring shell hooks into every LLM call so responses are grounded in DAG entities and verified facts rather than prompt-level suggestions the model can ignore. ## Core Features & Use Cases - Hook-based enforcement: Four shell hooks (pre_llm_call, transform_llm_output, post_tool_call, on_session_end) automatically inject DAG entities and stored facts into context, then critique and refine significant responses with real API calls. - Real reasoning pipeline: self-refine.py (generate, critique, DAG-grounded refine) and multi-perspective.py (3 parallel expert calls plus judge synthesis) make actual API calls instead of emitting prompt templates. - Persistent fact memory: fact-store.py saves verified facts to disk and recalls them by keyword across sessions, while context-injector.py queries project .dag files for relevant entities before generation. - Use Case: When answering architecture questions about a codebase, the pipeline loads matching DAG entities and stored facts, generates an answer, then runs a critique-and-refine pass that can only cite entities present in the DAG, flagging anything else as unverified. ## Quick Start Enable the four intelligence hooks in your config.yaml with hooks_auto_accept set to true, then ask the agent a hard technical question so the pipeline grounds and refines the answer automatically.

Frequently Asked Questions about intelligence-engine

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up the intelligence engine hooks?▼

Set hooks_auto_accept to true in your config, then register the four hook scripts under pre_llm_call, transform_llm_output, post_tool_call, and on_session_end in config.yaml. Verify the setup with dag hooks list and dag hooks doctor.

How does DAG grounding prevent LLM hallucination?▼

The self-refine script runs a critique pass then a refine pass constrained to entities present in the project .dag file. Claims not found in the ground truth are flagged as unverified instead of being invented with specific numbers or names.

Why does the transform_llm_output hook time out?▼

The hook runs self-refine, which makes two API calls taking 60 to 90 seconds. The default 5 second timeout kills it before completion, so set the hook timeout to at least 120 seconds in config.yaml.

What API key do the intelligence scripts need?▼

Scripts that call the DeepSeek API require DEEPSEEK_API_KEY in the environment, sourced from ~/.dag/.env. The key in config.yaml may differ, and the .env key is the one the scripts actually load.

Do the Tree of Thoughts and Graph of Thoughts executors really improve reasoning?▼

No. The technique executors like tot-executor.py and got-executor.py output structured prompt templates, so the model simulates the reasoning rather than executing it. The scripts with measured impact are self-refine.py, multi-perspective.py, context-injector.py, and fact-store.py.

How many API calls does the full pipeline cost per answer?▼

The standard pipeline uses context injection plus self-refine for about 3 calls. Adding multi-perspective debate for hard questions brings the total to roughly 7 calls, which the documentation estimates at about $0.0035 at DeepSeek prices.