Search Modes
Goal
Know which search command to use and when — keyword, hybrid, or direct — so every lookup is fast and returns the right result.What the User Gets
Without this: the agent fumbles between search commands, returns chunks when full pages are needed, runs expensive semantic searches when a direct get would do, or misses results entirely. With this: every lookup uses the optimal mode, token budgets are respected, and the user gets the right information in the fewest calls.Implementation
Tricky Spots
- Search returns chunks, not full pages. After
modusbrain searchormodusbrain query, you get excerpts. Always runmodusbrain get <slug>to load the full page when the chunk confirms relevance. Don’t answer questions from chunks alone when the full context matters. - Keyword search works without embeddings. On day one before any embedding run,
modusbrain searchstill works. Don’t tell the user “search isn’t available yet” — keyword search is always available. - Don’t use hybrid search for known names.
modusbrain query "Pedro Franceschi"wastes embedding compute. Usemodusbrain search "Pedro Franceschi"or better yetmodusbrain get pedro-franceschiif you know the slug. - Token budget awareness. A full page via
modusbrain getcan be large. Read the search chunks first to confirm relevance before pulling the full page. “Did anyone mention the Series A?” — search results (chunks) are probably enough. “Tell me everything about Pedro” — get the full page. - Hybrid search needs embeddings to have been run. If
modusbrain queryreturns nothing butmodusbrain searchfinds results, the embeddings haven’t been generated yet. Run the embedding pipeline first.
How to Verify
- Run
modusbrain search "Pedro"— confirm it returns chunks with matching text and slug references. - Run
modusbrain query "who works at fintech companies"— confirm it returns semantically relevant results (not just keyword matches on “fintech”). - Run
modusbrain get pedro-franceschi— confirm it returns the full page with compiled truth and timeline. - Compare: search for the same entity using all three modes. Keyword should be fastest, hybrid should surface conceptual matches, direct should return the complete page.
- After a search returns a chunk, run
modusbrain geton the slug from that chunk. Confirm the full page contains more context than the chunk alone.
Part of the ModusBrain Skillpack.