An autonomous, deterministic 5-Agent Competitive Intelligence System that continuously monitors web updates, grounds findings using hybrid RAG, executes self-correction verification loops, and delivers actionable briefings to Slack with Human-in-the-Loop (HITL) approval gates.
Monitoring competitor updates (pricing shifts, product releases, landing page changes) usually requires tedious manual scraping and context switching. Standard LLM web-summarizers suffer from hallucinations, duplicate alerts, and lack of historical context.
SentinelIQ solves this with an engineering-first, multi-agent architecture built on top of a PostgreSQL Blackboard State Pattern. It guarantees factual groundedness through sentence-level verification gates, avoids redundant processing using upfront content-hash diffing, and keeps human reviewers in control via interactive Slack approvals.
āāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāāāāāā
ā 1. SCOUT ā āā> ā 2. RESEARCHER ā āā> ā 3. CRITIC ā āāā
ā (Scrape/Hash) ā ā (Hybrid RAG) ā ā (Groundedness <0.7) ā ā
āāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāāāāāā ā (Max 2 Retries)
ā ā ā ā
āāāāāāāāāāāāāāāāāāāāāāāāāā¼āāāāāāāāāāāāāāāāāāāāāāāāāāā ā
ā¼ ā
[ PostgreSQL Blackboard State ] <āāāāāāāāāāāāāāāāāāāāāāāāā
ā
ā¼
āāāāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāāāāāā
ā 4. STRATEGIST ā āā> ā 5. EDITOR ā āā> [ Slack Webhook ]
ā(Actionable Synthesis) ā (Interactive HITL) ā
āāāāāāāāāāāāāāāāāāāāā āāāāāāāāāāāāāāāāāāāāāāā
- Scrapes target sites using n8n + Cheerio.
- Computes content-hash diffs to drop duplicate content immediately before embedding or calling LLMs, saving token budget.
- Executes hybrid search (Dense Vectors + BM25 Sparse) in Qdrant.
- Applies cross-encoder reranking and temporal filtering (
captured_at) to retrieve net-new context versus historical competitor behavior.
- Evaluates generated findings against raw source snippets using sentence-level entailment checks.
- If confidence score drops below 0.7, it triggers a state feedback loop, incrementing the retry counter and re-querying the Researcher (capped at 2 retries to prevent infinite loops).
- Translates validated updates into structured intelligence: Threat Level, Market Opportunities, and Suggested Counter-Actions.
- Constructs interactive Slack Block Kit payloads with Approve, Edit, or Reject actions before final dissemination.
- Shared Blackboard State Pattern: Agents do not pass huge context directly in payload strings. Instead, they read/append to a shared JSON state record stored in PostgreSQL, keyed by
run_id. This guarantees atomic state transitions, observability, and easy debugging. - Cost & Token Optimization: Content-hash diffing drops unchanged HTML at step 1. Embeddings and local inference are offloaded to Ollama (
nomic-embed-text), keeping embedding costs at zero. - Groundedness Safeguards: Forces factual entailment verification prior to Slack dispatch, drastically reducing hallucination rates in executive summaries.
- Orchestration & Workflows: n8n
- Vector Store & Search: Qdrant (Dense + Sparse Hybrid)
- Relational Database & State: PostgreSQL with pgvector
- Local Inference: Ollama (
llama3,nomic-embed-text) - Infrastructure: Docker & Docker Compose
- Integrations: Slack Webhooks / Block Kit
- Languages & Scripting: Python, Node.js (Cheerio)
.
āāā docker-compose.yml # Production-ready multi-container orchestration
āāā .env.example # Template for required environment variables
āāā postgres/
ā āāā init/ # SQL scripts for Blackboard state & table schemas
āāā workflows/
ā āāā sentinel_iq.json # Exported n8n workflow pipeline
āāā README.md # System documentation
- Docker Desktop (v20.10+) installed.
- Git installed.
git clone https://github.com/YourUsername/SentinelIQ.git
cd SentinelIQCopy .env.example to .env and adjust your credentials:
cp .env.example .env
Start PostgreSQL, Qdrant, Ollama, and n8n in detached mode:
docker-compose up -d
Verify all containers are running:
docker-compose ps
docker exec -it sentinel_ollama ollama pull nomic-embed-text docker exec -it sentinel_ollama ollama pull llama3
- Open n8n in your browser:
http://localhost:5678 - Create your admin account on first run.
- Navigate to Workflows ā Import from File.
- Select
workflows/sentinel_iq.jsonfrom this repository. - Activate the workflow!
All scraping, state management, vector embeddings, and LLM evaluations run locally or within containerized environments. No proprietary or confidential corporate data is sent to external LLM APIs unless explicitly configured.
Syed Muhammad Farrukh Aijaz
Embedded & Applied AI Systems Engineer
M.S. Student in Electrical & Electronics Engineering (AI & Robotics) @ Middle East Technical University (METU)
- LinkedIn: Syed Muhammad Farrukh Aijaz
- GitHub: @FarrukhAijaz
- Email: [email protected]
This project is licensed under the MIT License - see the LICENSE file for details.