HexdocsMcp.Embeddings (HexDocs MCP v0.1.1)

View Source

Functions for generating embeddings from markdown chunks using Ollama.

Summary

Functions

Generate embeddings for all chunks in a package and store them in SQLite.

Search for similar text in embeddings using SQLite.

Functions

generate(package, version, model, opts \\ [])

Generate embeddings for all chunks in a package and store them in SQLite.

Parameters

  • package - The name of the package
  • version - The version of the package or "latest"
  • model - The Ollama model to use, "nomic-embed-text" is recommended
  • progress_callback - (Optional) Function called with progress updates

Returns

  • {:ok, count} - The number of embeddings generated

search(query, package, version, model, opts \\ [])

Search for similar text in embeddings using SQLite.

Parameters

  • query - The search query
  • package - The name of the package to search in
  • version - The version of the package or "latest"
  • model - The Ollama model to use, "nomic-embed-text" is recommended
  • top_k - (Optional) Number of results to return, defaults to 3
  • progress_callback - (Optional) Function called with progress updates