chore: 初始化仓库,导入项目基线代码
Academy v0.8.3 完整代码基线:Go 后端(internal/cmd/cli/mcp-server/docreader)、 Vue 前端(frontend)、数据库迁移(migrations)、部署编排(docker/helm/deploy)与文档。 今日开发的培训推送管理改动随后单独提交。
This commit is contained in:
commit
7ec21f35b0
5767 files changed
+1436788
No files matched your search
@@ -0,0 +1,47 @@
|
||||
// Package search implements the `academy search` command tree:
|
||||
// chunks / kb / docs / sessions.
|
||||
package search
|
||||
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"academy/cli/internal/cmdutil"
|
||||
)
|
||||
|
||||
// NewCmdSearch builds the `academy search` parent. Pure dispatcher to the
|
||||
// four subcommands - users must pick a verb (chunks / kb / docs / sessions).
|
||||
func NewCmdSearch(f *cmdutil.Factory) *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "search",
|
||||
Short: "Search across chunks, knowledge bases, documents, or sessions",
|
||||
Long: `Verb-noun search tree:
|
||||
|
||||
search chunks "<q>" --kb X hybrid retrieval (RAG search)
|
||||
search kb "<q>" find KBs by name / description
|
||||
search docs "<q>" --kb X find documents inside a KB
|
||||
search sessions "<q>" find chat sessions by title / description`,
|
||||
Example: ` academy search chunks "what is RAG?" --kb engineering
|
||||
academy search kb "marketing"
|
||||
academy search docs "Q3 forecast" --kb finance
|
||||
academy search sessions "onboarding"`,
|
||||
}
|
||||
|
||||
cmd.AddCommand(NewCmdChunks(f))
|
||||
cmd.AddCommand(NewCmdKB(f))
|
||||
cmd.AddCommand(NewCmdDocs(f))
|
||||
cmd.AddCommand(NewCmdSessions(f))
|
||||
return cmd
|
||||
}
|
||||
|
||||
// emptyContentSearchHint returns an actionable note when a KB-scoped content
|
||||
// search (chunks / docs) yields zero results, so an agent can distinguish
|
||||
// "no match" from "the KB has no indexed content". Empty when n > 0 so it
|
||||
// never adds noise to real results.
|
||||
func emptyContentSearchHint(n int) string {
|
||||
if n > 0 {
|
||||
return ""
|
||||
}
|
||||
return "0 results: this may be no match, OR the KB has no indexed chunks. " +
|
||||
"Check `academy kb status <kb>` (chunk_count) and `academy doc list --kb <kb>` (parse_status); " +
|
||||
"documents in parse_status=draft are not indexed — run `academy doc reparse <doc-id>`."
|
||||
}
|
||||
Reference in new issue
Block a user