Add RAG (Retrieval Augmented Generation) tools for storing documentation in Qdrant vector database and querying with semantic search. This replaces the Python tools/rag implementation with a native Go solution. New commands: - core rag ingest [directory] - Ingest markdown files into Qdrant - core rag query [question] - Query vector database with semantic search - core rag collections - List and manage Qdrant collections Features: - Markdown chunking by sections and paragraphs with overlap - UTF-8 safe text handling for international content - Automatic category detection from file paths - Multiple output formats: text, JSON, LLM context injection - Environment variable support for host configuration Dependencies: - github.com/qdrant/go-client (gRPC client) - github.com/ollama/ollama/api (embeddings API) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
25 lines
636 B
Go
25 lines
636 B
Go
// Package rag provides RAG (Retrieval Augmented Generation) commands.
|
|
//
|
|
// Commands:
|
|
// - core rag ingest: Ingest markdown files into Qdrant
|
|
// - core rag query: Query the vector database
|
|
// - core rag collections: List and manage collections
|
|
package rag
|
|
|
|
import (
|
|
"github.com/host-uk/core/pkg/cli"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
func init() {
|
|
cli.RegisterCommands(AddRAGCommands)
|
|
}
|
|
|
|
// AddRAGCommands registers the 'rag' command and all subcommands.
|
|
func AddRAGCommands(root *cobra.Command) {
|
|
initFlags()
|
|
ragCmd.AddCommand(ingestCmd)
|
|
ragCmd.AddCommand(queryCmd)
|
|
ragCmd.AddCommand(collectionsCmd)
|
|
root.AddCommand(ragCmd)
|
|
}
|