-
Notifications
You must be signed in to change notification settings - Fork 2
Command Keyword
Rick Hightower edited this page Feb 2, 2026
·
1 revision
name: agent-brain-keyword description: Search using BM25 keyword matching for exact terms parameters:
- name: query description: The exact search terms required: true
- name: top-k description: Number of results (1-20) required: false default: 5 skills:
- using-agent-brain
Performs BM25 keyword search for fast, exact term matching. This mode is optimized for technical queries where you know the exact terms, function names, error codes, or identifiers.
Keyword search is ideal for:
- Error messages and codes
- Function and class names
- Configuration keys
- Technical identifiers
- When speed is critical (10-50ms response)
/agent-brain-keyword <query> [--top-k <n>]
| Parameter | Required | Default | Description |
|---|---|---|---|
| query | Yes | - | The exact search terms |
| top-k | No | 5 | Number of results (1-20) |
| Use Keyword/BM25 | Use Semantic Instead |
|---|---|
| "AuthenticationError" | "how does auth work" |
| "recursiveCharacterTextSplitter" | "text splitting strategies" |
| "OPENAI_API_KEY" | "API configuration" |
| "def process_document" | "document processing flow" |
| error codes, stack traces | conceptual explanations |
Verify the server is running:
agent-brain statusagent-brain query "<query>" --mode bm25 --top-k <top-k># Search for error message
agent-brain query "ConnectionRefusedError" --mode bm25
# Search for function name
agent-brain query "process_document" --mode bm25
# Search for configuration key
agent-brain query "EMBEDDING_MODEL" --mode bm25
# More results
agent-brain query "AuthenticationError" --mode bm25 --top-k 10
# Search for multiple terms
agent-brain query "OAuth client_id redirect_uri" --mode bm25Format search results with source citations:
For each result, present:
- Source: File path or document name
- Score: BM25 relevance score
- Content: Relevant excerpt with matching terms highlighted
## Keyword Search Results for "AuthenticationError"
### 1. src/auth/exceptions.py (Score: 12.4)
class AuthenticationError(Exception):
"""Raised when authentication fails."""
def __init__(self, message: str, code: str = "AUTH_FAILED"):
self.code = code
super().__init__(message)
### 2. tests/test_auth.py (Score: 8.7)
def test_invalid_credentials_raises_authentication_error():
with pytest.raises(AuthenticationError) as exc:
auth_client.authenticate("invalid", "credentials")
assert exc.value.code == "AUTH_FAILED"
### 3. docs/errors/authentication.md (Score: 6.2)
## AuthenticationError
Raised when user credentials are invalid or expired.
**Common causes:**
- Invalid API key
- Expired token
- Missing credentials
---
Found 3 results
When referencing results in responses, always cite the source:
- "The error is defined in
src/auth/exceptions.py..." - "According to the test in
tests/test_auth.py..."
Error: Could not connect to Agent Brain server
Resolution: Start the server with agent-brain start --daemon
No results found
Resolution:
- Verify the exact spelling of search terms
- Try partial matches or wildcards if supported
- Use semantic search for conceptual queries:
--mode vector - Check if documents are indexed:
agent-brain status
Warning: No documents indexed
Resolution: Index documents first:
agent-brain index /path/to/docsError: BM25 index not available
Resolution: Re-index documents to build the BM25 index:
agent-brain reset --yes
agent-brain index /path/to/docs| Metric | Typical Value |
|---|---|
| Latency | 10-50ms |
| API calls | None (local computation) |
| Best for | Exact terms, technical queries |
- Speed: 10-50ms vs 800-1500ms for semantic
- No API calls: Works offline, no OpenAI costs
- Exact matching: Finds precise terms without semantic drift
- Deterministic: Same query always returns same results
- No conceptual understanding: Won't find "authentication" when searching "login"
- Exact match bias: Misspellings won't match
- No synonym expansion: "error" won't match "exception"
- Design-Architecture-Overview
- Design-Query-Architecture
- Design-Storage-Architecture
- Design-Class-Diagrams
- GraphRAG-Guide
- Agent-Skill-Hybrid-Search-Guide
- Agent-Skill-Graph-Search-Guide
- Agent-Skill-Vector-Search-Guide
- Agent-Skill-BM25-Search-Guide
Search
Server
Setup
- Pluggable-Providers-Spec
- GraphRAG-Integration-Spec
- Agent-Brain-Plugin-Spec
- Multi-Instance-Architecture-Spec