HexdocsMcp.Embeddings (HexDocs MCP v0.6.0)
View SourceFunctions for generating embeddings from markdown chunks using Ollama.
Summary
Functions
Generates a SHA-256 hash for the given text content.
Delete all embeddings for a package and version.
Check if embeddings exist for a package and version.
Generate embeddings for all chunks in a package and store them in SQLite.
Search for similar text in embeddings using SQLite.
Functions
Generates a SHA-256 hash for the given text content.
Returns a lowercase hex-encoded string representation of the hash.
Delete all embeddings for a package and version.
Parameters
package
- The name of the packageversion
- The version of the package or "latest"
Returns
{:ok, count}
- The number of embeddings deleted
Check if embeddings exist for a package and version.
Parameters
package
- The name of the packageversion
- The version of the package or "latest"
Returns
true
- Embeddings existfalse
- No embeddings exist
Generate embeddings for all chunks in a package and store them in SQLite.
Parameters
package
- The name of the packageversion
- The version of the package or "latest"model
- The Ollama model to use, "nomic-embed-text" is recommendedprogress_callback
- (Optional) Function called with progress updates
Returns
{:ok, count}
- The number of embeddings generated
Search for similar text in embeddings using SQLite.
Parameters
query
- The search querypackage
- The name of the package to search inversion
- The version of the package or "latest"model
- The Ollama model to use, "nomic-embed-text" is recommendedtop_k
- (Optional) Number of results to return, defaults to 3progress_callback
- (Optional) Function called with progress updatesall_versions
- (Optional) Include all versions in search, defaults to false