qmd

package
v0.2.30 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 11, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package qmd provides a client for QMD semantic search.

Index

Constants

This section is empty.

Variables

View Source
var DefaultClient = NewClient("")

DefaultClient is the global QMD client instance.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client wraps the QMD CLI for semantic search.

func NewClient

func NewClient(binary string) *Client

NewClient creates a new QMD client.

func (*Client) ClearCache

func (c *Client) ClearCache()

ClearCache clears the search result cache.

func (*Client) FindRelatedTasks

func (c *Client) FindRelatedTasks(ctx context.Context, query string, count int) ([]RelatedTask, error)

FindRelatedTasks searches for tasks related to the given query. It parses task IDs from the document paths (expecting format: task-{id}.md)

func (*Client) IsAvailable

func (c *Client) IsAvailable() bool

IsAvailable returns true if QMD is installed and usable. Lazily checks on first call.

func (*Client) Query

func (c *Client) Query(ctx context.Context, query string, collection string, count int) ([]SearchResult, error)

Query performs a hybrid search with re-ranking (best quality).

func (*Client) Search

func (c *Client) Search(ctx context.Context, query string, collection string, count int) ([]SearchResult, error)

Search performs a keyword search (BM25).

func (*Client) VSearch

func (c *Client) VSearch(ctx context.Context, query string, collection string, count int) ([]SearchResult, error)

VSearch performs a vector/semantic search.

type RelatedTask

type RelatedTask struct {
	TaskID  int64
	Title   string
	Score   float64
	Project string
}

RelatedTask represents a related task found via semantic search.

type SearchResult

type SearchResult struct {
	DocID   string  `json:"docid"`
	Score   float64 `json:"score"`
	Path    string  `json:"path"`
	Title   string  `json:"title"`
	Snippet string  `json:"snippet"`
}

SearchResult represents a single search result from QMD.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL