Search And Indexing

Search is how you keep a project understandable after it grows beyond one file.

Embedr has two broad search modes:

  • exact text search,
  • semantic search.

Hybrid search combines both.

Exact search

Exact search finds strings. It is the right tool when you know the symbol, function, include, constant, or error text.

Examples:

  • WiFi.begin,
  • LED_PIN,
  • Serial.begin,
  • DHT.h,
  • TODO.

Exact search is fast and deterministic. Embedr uses ripgrep when available and falls back to a portable scanner.

Semantic search

Semantic search finds meaning. It is the right tool when you do not know the exact words.

Examples:

  • "code that reads the ultrasonic sensor",
  • "where calibration happens",
  • "button debounce logic",
  • "the function that sends telemetry".

Semantic search requires codebase indexing.

How indexing works

Indexing scans supported files, splits them into chunks, generates embeddings for those chunks, and stores vectors locally for similarity search.

Supported file types include common firmware source, markdown, JSON, text, and project configuration files. Large files and ignored build folders are skipped.

The default maximum indexed file size is intentionally conservative so that generated or binary-like files do not dominate the index.

Enable indexing

Open Settings in the editor and find Codebase Indexing.

You can:

  • enable auto-indexing,
  • manually index the project,
  • re-index after large changes,
  • clear the index.

Auto-indexing keeps the index synchronized with file changes using the file watcher.

Search palette

Open the search palette from the toolbar or keyboard shortcut. Choose:

Mode Best for
Quick Exact text and filenames.
Semantic Conceptual search.
Hybrid Most engineering searches where both words and meaning matter.

Click a result to open the file at the relevant location.

Agent search

The agent can use search tools during a conversation. If indexing is enabled, it can ask semantic questions about the project instead of reading every file.

This helps with:

  • large firmware projects,
  • inherited codebases,
  • long workshop examples,
  • projects with datasheets and notes mixed in.

When to re-index

Re-index after:

  • importing many datasheets,
  • generating many files,
  • large refactors,
  • moving directories,
  • branch switches,
  • clearing or restoring project files outside the app.

If semantic search returns stale results, re-index before debugging the search itself.

What not to index

Do not index generated output unless you have a specific reason. Build directories, package caches, binary output, and vendor-generated code can pollute results.

Good index content:

  • source code,
  • headers,
  • project docs,
  • datasheet markdown,
  • .zen source,
  • hand-written config.

Poor index content:

  • .pio/,
  • binary assets,
  • generated object files,
  • large vendor drops.

Search discipline

Use exact search first when you know the name. Use semantic search when you know the concept. Use hybrid when you know both a concept and a few likely terms.

The fastest search is the one with the clearest question.