Skip to content

Unified Ask (`!ask`)

The !ask command is an agentic search engine that queries all community knowledge sources, synthesizes a single AI-powered answer with citations, and uses multi-round gap detection for thorough results.

!ask <question> Search all relevant sources, get synthesized answer
!ask <question> --broadcast Search + broadcast answer to multiple groups
!ask --sources List available search sources and their status

Aliases: !a

Examples:

!ask What are the claude code plugins and lessons learned?
!ask What link was posted about AI in the DoD?
!ask How do I set up ATAK?
!ask --broadcast What's the latest on drone regulations?

!ask uses a 4-stage agentic pipeline that intelligently searches across 7 knowledge sources:

Round 1 (~3-5s):
├─ ROUTER — AI picks 2-4 relevant sources for the question
│ Bot sends progress: "Searching wiki, outline docs, wikipedia..."
├─ PARALLEL SEARCH — Selected sources queried simultaneously
└─ GAP DETECTION — AI reviews results: "Have enough info?"
Round 2 (only if gaps detected, ~3-5s):
├─ Search additional sources identified by gap detection
└─ GAP DETECTION again
Round 3 (final, if still gaps):
└─ Search remaining sources, then synthesize regardless
Synthesis (~2-3s):
AI combines ALL gathered context → single answer with citations

Max 3 rounds. After round 3, the bot synthesizes whatever context has been gathered. If no relevant sources are found, it falls back to a general AI answer with a disclaimer.


The router (a fast AI call) selects which sources to query based on the question:

SourceWhen SelectedSearch MethodSpeed
IrregularPedia WikiTechnical/community topics, how-to, guidesHybrid (keyword + semantic embeddings)~2-3s
Outline DocsTeam documentation, meeting notes, policiesOutline API full-text search~1-2s
File ArchiveLooking for specific files, documents, PDFsSmart search + grep~2-4s
RSS LinksNews, recent articles, shared linksPostgreSQL term-based search~0.5s
Q&A HistoryPreviously asked/answered questionsPostgreSQL term-based search~0.5s
WikipediaGeneral knowledge, concepts, people, organizationsMediaWiki Action API~1-2s
Google Knowledge GraphEntity disambiguation, quick factsKnowledge Graph API~1s

The AI router uses these rules to pick sources:

  • Technical questions about community tools → wiki first, then outline
  • General knowledge or “what is X” → wikipedia, knowledge_graph
  • “Has anyone asked about…” → qa_history
  • Looking for a specific file → files
  • Recent news or articles → rss
  • AI/security/tech topics → always includes wiki
  • Topics that may not be community-specific → includes wikipedia

🤖 Ask: "what are the claude code plugins and lessons learned?"
Claude Code supports several plugin types for extending its capabilities:
1. **MCP Servers** - Model Context Protocol servers that provide
additional tools. Configure in `.claude/settings.json`...
2. **Custom Slash Commands** - Define in `.claude/commands/`...
**Key lessons learned from production projects:**
- Always establish CLAUDE.md files early
- Use project rules to enforce coding standards
- ...
📚 Sources (searched: wiki, outline, wikipedia):
• Claude Code - IrregularPedia: https://irregularpedia.org/ai-ml/claude-code/
• Project Rules & Lessons Learned: https://irregularpedia.org/ai-ml/project-rules-lessons-learned/
• Claude Code Setup - Outline: https://outline.irregularchat.com/doc/...

Format details:

  • Header echoes the original question
  • AI-synthesized answer (max ~1500 chars for Signal readability)
  • Source list at bottom with clickable URLs
  • Sources searched noted parenthetically

!ask is an orchestrator — it calls into the same search backends as the individual commands, but combines and synthesizes results.

CommandWhat It DoesWhen to Use
!askUnified search across all sources + AI synthesisGeneral questions, when you don’t know which source to check
!wikiask / !waSearch IrregularPedia wiki onlySpecific wiki knowledge
!ol askSearch Outline docs onlySpecific team documentation
!files -sSmart file search onlyLooking for a specific file
!aiPure AI (no source search)Opinions, creative tasks, general chat
!qaSubmit question to Q&A database for community answersWant human answers tracked over time

When to use !ask vs specific commands:

  • Use !ask when you’re not sure which source has the answer
  • Use specific commands when you know exactly where to look (faster, more targeted)
  • !ask adds ~5-15 seconds of overhead for routing and gap detection

The original !ask command (submit a question for community answers) has been renamed to !qa. See Q&A System for documentation.

Old CommandNew CommandPurpose
!ask <question>!qa <question>Submit question for community tracking
!q <question>!q <question>Still works (alias for !qa)
!question <hash>!question <hash>View question details (unchanged)
(new)!ask <question>Unified agentic search

ScenarioBehavior
No sources return resultsFalls back to pure AI answer with disclaimer
One source times outContinues with remaining sources, notes timeout
All sources timeoutReturns error suggesting specific commands
OpenAI rate limitQueues synthesis, retries once after 5s
Wikipedia API downSkips, uses remaining sources
Google KG API key missingSkips Knowledge Graph silently

Per-source timeout: 5 seconds Total timeout: 30 seconds max — synthesizes with whatever is gathered Rate limit: 10 !ask calls per hour per user


VariablePurpose
OPENAI_API_KEYPowers the router, gap detection, and synthesis (gpt-4o-mini)
VariablePurposeDefault
GOOGLE_KG_API_KEYGoogle Knowledge Graph APIDisabled if not set
QA_WEB_URLBase URL for Q&A web links in resultsNone

Wikipedia search requires no API key or authentication (uses the public MediaWiki Action API).


  1. Router — Single gpt-4o-mini call (temperature: 0.1) picks 2-4 sources
  2. Parallel Search — All selected sources searched simultaneously via Promise.all()
  3. Gap Detection — gpt-4o-mini evaluates gathered context, decides if more sources are needed
  4. Synthesizer — gpt-4o-mini combines all context into a cohesive answer (temperature: 0.3 with context, 0.7 without)
FilePurpose
src/src/utils/unified-search.tsRouter, parallel search, gap detection, synthesizer
src/src/utils/wikipedia-client.tsWikipedia MediaWiki Action API client
src/src/utils/knowledge-graph-client.tsGoogle Knowledge Graph API client
src/src/utils/rss-search.tsRSS links term-based search
src/src/bot/command-handler.tshandleUnifiedAsk() method, command routing

For RSS and Q&A history, natural language questions are split into individual search terms with stop words removed. For example:

Question: "was there a link posted last week about ai in the dod?"
Stop words removed: ["link", "posted", "last", "week", "about"]
Search terms: ["ai", "dod"]
SQL: WHERE (title ILIKE '%ai%' OR summary ILIKE '%ai%')
OR (title ILIKE '%dod%' OR summary ILIKE '%dod%')

This dramatically improves recall compared to matching the entire question as a single pattern.