Search & Discord Commands
TrenchQuarters provides two ways for members to find information in the Field Manual: a web search page and Discord slash commands.
Web Search
Go to Field Manual → Search or navigate to /field-manual/search. Enter a query and press Enter or click Search. Three search modes run simultaneously against all published FM pages:
Keyword Search
Uses PostgreSQL full-text search against page titles and content. Returns up to 10 results with a text snippet. Falls back to pattern matching if full-text indexing is unavailable.
Semantic Search
Compares your query against page embeddings using cosine similarity (powered by Ollama). Only returns results with a similarity score above 60%. Results show the score as a percentage. Returns up to 8 results.
Semantic search finds pages that mean the same thing as your query even if they use different words — useful when you don't know the exact terminology.
AI Analysis
Takes the top keyword results as context and generates a direct natural-language answer to your query. The answer cites which pages it drew from, shown in a Sources section beneath the answer.
Deduplication
Results are deduplicated across all three modes. AI sources are shown first; semantic results exclude pages already shown by AI; keyword results exclude pages already shown by either other mode.
Technical Manual Search
The same query also runs against all Technical Manual pages in parallel. TM results appear in a separate section below the FM results.
Discord Slash Commands
Members can search the Field Manual and the Foxhole wiki directly from Discord using slash commands.
/fm search <query>
Searches your regiment's Field Manual. The reply is public by default.
The bot runs all three search modes in sequence, editing the same reply as each stage completes so members see results progressively:
- Keyword search — results appear immediately
- Semantic search — higher-quality matches added above keyword results
- AI analysis — direct answer with source citations added at the top
Results are deduplicated across modes (AI > semantic > keyword). Stages with no results are omitted silently.
Options
| Option | Required | Description |
|---|---|---|
query |
Yes | What you are looking for |
hidden |
No | Set to True to make the reply visible only to you (default: False) |
/fm reference
Posts a single Field Manual page as a public reference embed. The embed includes an AI-generated summary of the page content, a link to the full page, and the category name in the footer.
There are two ways to use this command:
Search mode — provide a query, the bot searches using keyword and semantic modes and shows you a private dropdown:
- Results appear in an ephemeral message (only you can see them).
- Pick the page you want to share from the dropdown.
- The bot posts a public reference embed and clears your private message.
Direct mode — provide a page path to skip search and post immediately:
/fm reference page: infantry-doctrine/fire-and-movement
The path format is category-slug/page-slug, matching the URL of the page on the web dashboard. The bot looks the page up by slug, generates a summary, and posts the reference publicly without any intermediate step.
Options
| Option | Required | Description |
|---|---|---|
query |
No | Search terms to find a page (use with search mode) |
page |
No | Direct page path: category-slug/page-slug (use with direct mode) |
At least one of query or page must be provided.
/wiki search <query>
Searches the Foxhole wiki using the same three-stage progressive approach. The reply is public.
- Keyword search via the MediaWiki API — returns up to 10 wiki articles
- Semantic search — fetches intro extracts and re-ranks by embedding similarity (requires Ollama)
- AI summary — generates a concise answer from the top articles and cites which ones it used
Search Limitations
- Semantic search and AI analysis both require the Ollama embedding/language service to be running. If a stage is unavailable or returns no results it is silently omitted — the other stages still appear.
- AI answers are generated from a limited context window (top 5 pages). For comprehensive doctrine coverage, use the web search where all pages are indexed.
- The AI will say clearly if the answer is not in the provided content — it does not guess or invent information.
- Bot responses use only published FM pages. Draft pages are never included.