Skip to main content

Module embeddings

Module embeddings 

Source
Expand description

Embedding generation and semantic search for code objects.

Re-exports shared types from nusy-graph-query and adds codegraph-specific functions for embedding CodeNodes and attaching embeddings to RecordBatches.

Structs§

HashEmbeddingProvider
Deterministic hash-based embedding provider for codegraph (768-dim).
SearchResult
A search result from semantic search.

Enums§

EmbeddingError
Errors from embedding operations.

Traits§

EmbeddingProvider
Trait for embedding providers.

Functions§

attach_embeddings
Update a CodeNodes RecordBatch with embedding vectors.
cosine_similarity
Cosine similarity between two vectors.
embed_nodes
Embed all CodeNodes that have embeddable text.
node_to_embed_text
Build the embeddable text for a CodeNode.
semantic_search
Semantic search over embedded CodeNodes.

Type Aliases§

Result