How mohatemtc/barq-sprints-ai-servicenow-support-assistant-4 works
BARQ AI is an event-driven ServiceNow support assistant: incident and knowledge-base events enter through webhooks, background tasks coordinate processing, and the assistant retrieves knowledge and prepares a human-reviewable suggestion. A separate KB synchronization path keeps the retrieval index current. The repository also contains a standalone grounded-generation agent implementation. Evidence is limited to the README and indexed or excerpted files; connections for unsampled behavior are omitted.
Main entry points: kb_sync_service.py KB Sync · s3_worker.py Agent Worker · tasks.py Background Tasks · executor.py Grounded Executor
Components 20
Event Intake
- Incident Rule
businessRule/business_rule.js - FastAPI App
src/barq_ai_support/main.py - Incident Webhook
src/barq_ai_support/webhook.py - KB Webhook
src/barq_ai_support/kb_webhook.py
Async Processing
- Task Queue
src/barq_ai_support/celery_app.py - Background Tasks
src/barq_ai_support/tasks.py
Knowledge Pipeline
- KB Sync
src/barq_ai_support/kb_sync_service.py - ServiceNow Client
src/barq_ai_support/servicenow_client.py - Article Chunker
src/barq_ai_support/ingestion/chunker.py - Embedding
src/barq_ai_support/ingestion/embedding.py - Qdrant Index
src/barq_ai_support/ingestion/qdrant_store.py - KB State
src/barq_ai_support/kb_state_store.py
Incident Assistant
- Semantic Retrieval
src/barq_ai_support/retrieval/retriever.py - Agent Worker
src/barq_ai_support/agent/s3_worker.py
Grounded Agent
- Grounded Executor
agent/executor.py - Grounding Prompt
agent/prompt.py - Agent Schemas
agent/schemas.py - Output Validators
agent/validators.py
Other components
- ServiceNow
- Support Reviewer
Connections 22
- ServiceNow → Incident Rule: creates incident
README.md - Incident Rule → Incident Webhook: posts event
README.md - FastAPI App → Incident Webhook: mounts route
src/barq_ai_support/main.py - FastAPI App → KB Webhook: mounts route
src/barq_ai_support/main.py - Incident Webhook → Background Tasks: dispatches task
src/barq_ai_support/webhook.py - KB Webhook → Background Tasks: dispatches task
src/barq_ai_support/kb_webhook.py - Background Tasks → Task Queue: registers tasks
src/barq_ai_support/tasks.py - Background Tasks → Agent Worker: runs agent
src/barq_ai_support/tasks.py - Background Tasks → KB Sync: runs sync
src/barq_ai_support/tasks.py - KB Sync → ServiceNow Client: fetches article
src/barq_ai_support/kb_sync_service.py - ServiceNow Client → ServiceNow: reads and writes
src/barq_ai_support/servicenow_client.py - KB Sync → Article Chunker: chunks article
src/barq_ai_support/kb_sync_service.py - KB Sync → Qdrant Index: updates index
src/barq_ai_support/kb_sync_service.py - KB Sync → KB State: tracks changes
src/barq_ai_support/kb_sync_service.py - Semantic Retrieval → Qdrant Index: queries index
src/barq_ai_support/retrieval/retriever.py - Agent Worker → Semantic Retrieval: searches knowledge
src/barq_ai_support/agent/s3_worker.py - Agent Worker → ServiceNow Client: loads and updates
src/barq_ai_support/agent/s3_worker.py - Agent Worker → Embedding: uses embeddings
src/barq_ai_support/agent/s3_worker.py - Agent Worker → Support Reviewer: suggests for review
README.md - Grounded Executor → Grounding Prompt: builds prompt
agent/executor.py - Grounded Executor → Agent Schemas: validates inputs
agent/executor.py - Grounded Executor → Output Validators: validates output
agent/executor.py