Skip to main content
BugViper exposes multiple search strategies over your indexed repositories, all backed by Neo4j. Full-text search uses Apache Lucene under the hood — the same engine that powers Elasticsearch — while semantic search uses cosine similarity over 1536-dimension vector embeddings. You can search by symbol name, peek at file content around any line, or describe what you’re looking for in plain English and let semantic search surface the most conceptually relevant code. The /search endpoint searches across Function, Class, and Variable nodes by name, docstring, and source code, then falls back to raw file content line-by-line if no symbol matches are found. Results are ranked by relevance score and include the type, name, file path, and line number.
curl "https://your-bugviper-instance/api/v1/query/search?query=parse_unified_diff&limit=10" \
  -H "Authorization: Bearer YOUR_FIREBASE_TOKEN"
{
  "results": [
    {
      "type": "function",
      "name": "parse_unified_diff",
      "path": "common/diff_parser.py",
      "line_number": 24,
      "score": 4.872
    }
  ],
  "total": 1,
  "query": "parse_unified_diff"
}

Filter by repository

Add repo_owner and repo_name query parameters to restrict results to a single repository:
curl "https://your-bugviper-instance/api/v1/query/search?query=authenticate&repo_owner=acme-corp&repo_name=my-api" \
  -H "Authorization: Bearer YOUR_FIREBASE_TOKEN"

Find a specific function, class, or variable

Use the CodeFinder endpoints when you know the exact (or approximate) name of the symbol you want.

Find a function

curl "https://your-bugviper-instance/api/v1/query/code-finder/function?name=get_user&fuzzy=true" \
  -H "Authorization: Bearer YOUR_FIREBASE_TOKEN"
Set fuzzy=true to match partial names (for example, get_user matches get_user_by_id and get_user_profile). Omit it or set it to false for an exact name match.

Find a class

curl "https://your-bugviper-instance/api/v1/query/code-finder/class?name=IngestionEngine&repo_owner=acme-corp&repo_name=my-api" \
  -H "Authorization: Bearer YOUR_FIREBASE_TOKEN"

Find a variable

curl "https://your-bugviper-instance/api/v1/query/code-finder/variable?name=MAX_TOOL_ROUNDS" \
  -H "Authorization: Bearer YOUR_FIREBASE_TOKEN"

Peek at file content

After finding a match by line number, use the peek endpoint to read the surrounding lines without fetching the entire file. This keeps responses fast even for large files.
curl "https://your-bugviper-instance/api/v1/query/code-finder/peek?path=src/api/auth.py&line=42&above=10&below=10" \
  -H "Authorization: Bearer YOUR_FIREBASE_TOKEN"
The above and below parameters control how many lines to show on each side of the anchor line (maximum 200 each). The response flags the anchor line with "is_anchor": true so you can highlight it in your interface. When full-text search isn’t enough — for example, when you want to find code by intent rather than by name — use semantic search. BugViper embeds your query and returns nodes ranked by cosine similarity from Neo4j vector indexes.
curl -X POST "https://your-bugviper-instance/api/v1/query/semantic" \
  -H "Authorization: Bearer YOUR_FIREBASE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "question": "embedding model configuration",
    "repoOwner": "acme-corp",
    "repoName": "my-api"
  }'
Results are ranked by similarity score and include the node name, type, file path, line number, and source code snippet:
{
  "results": [
    {
      "name": "EmbeddingModelName",
      "type": "variable",
      "path": "common/embedder.py",
      "line_number": 8,
      "score": 0.73
    },
    {
      "name": "embed_texts",
      "type": "function",
      "path": "common/embedder.py",
      "line_number": 22,
      "score": 0.69
    },
    {
      "name": "RoastResponse",
      "type": "class",
      "path": "common/embedder.py",
      "line_number": 41,
      "score": 0.68
    }
  ],
  "total": 3
}
Use full-text search when you know the name of a symbol or a string literal that appears in the source code. Use semantic search when you want to find code by what it does — for example, “rate limit handling” or “user authentication flow” — rather than by its exact identifier.Semantic search requires embeddings to be generated for the repository. If you indexed without embeddings, run the embed endpoint first.

Search by raw file content

The line search endpoint searches raw file content line-by-line and returns the matching lines with their file paths. This is useful for finding string literals, comments, or patterns that are not stored as named symbols.
curl "https://your-bugviper-instance/api/v1/query/code-finder/line?query=Authorization%3A+Bearer" \
  -H "Authorization: Bearer YOUR_FIREBASE_TOKEN"
Pair the returned path and line_number with the peek endpoint to read context around any match.