You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: guide/annotations.md
+34Lines changed: 34 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,6 +63,40 @@ Use `ccg://{namespace}/{path}#{symbol}` in `@see` when a behavior depends on cod
63
63
64
64
The path and symbol are optional, so `ccg://auth-svc/internal/auth` can point at a package/path scope and `ccg://auth-svc/` can point at a whole namespace.
65
65
66
+
## Retrieval Quality
67
+
68
+
Annotations are retrieval features. `retrieve_docs` and generated docs rank
69
+
file-level evidence from structured buckets such as `@index`, `@intent`,
70
+
`@domainRule`, `@sideEffect`, `@requires`, `@ensures`, and `@see`. Better
71
+
annotations make natural-language retrieval more precise, but only when the
72
+
tags describe real behavior.
73
+
74
+
Use tags by need:
75
+
76
+
| Situation | Preferred tags |
77
+
|-----------|----------------|
78
+
| File/package should be discoverable as a unit | `@index` |
79
+
| Public function, handler, CLI command, service method, or UI workflow has a clear purpose | `@intent` |
mcp.WithString("node_id", mcp.Description("Tree node ID as shown in search/retrieve/tree results (e.g. 'community:internal/analysis', 'package:internal/core', or 'file:internal/core/runtime.go'). Omit only for a bounded overview with depth set.")),
26
26
mcp.WithString("community_id", mcp.Description("Deprecated alias for node_id; accepts any tree node ID for compatibility.")),
27
27
mcp.WithNumber("depth", mcp.Description("Maximum tree depth to return (1=top-level communities/packages, 2=plus child packages/files). Recommended when node_id is omitted. Default: 0 (unlimited, only for small namespaces).")),
28
-
mcp.WithString("namespace", mcp.Description("Namespace. When set, reads that namespace's DB tree or wiki-index.json fallback.")),
28
+
mcp.WithString("namespace", mcp.Description("Namespace. When set, reads that namespace's DB-backed tree.")),
mcp.WithDescription("Search the RAG document tree by keyword. Matches against node labels and summaries. Returns breadcrumb paths to matching nodes."),
42
+
mcp.WithDescription("Search DB-backed documentation candidates by keyword. Matches graph nodes and annotation evidence, then returns breadcrumb paths to matching files."),
mcp.WithNumber("limit", mcp.Description("Maximum number of results (default: 10, max: 500)")),
45
-
mcp.WithString("namespace", mcp.Description("Namespace. When set, searches the namespace-specific doc-index.json.")),
45
+
mcp.WithString("namespace", mcp.Description("Namespace. When set, searches that namespace's DB-backed documentation candidates.")),
46
46
),
47
47
Handler: h.searchDocs,
48
48
},
49
49
{
50
50
Tool: mcp.NewTool("retrieve_docs",
51
-
mcp.WithDescription("Retrieve relevant generated docs for a natural-language or multi-keyword query. Uses DB-backed graph evidence first, falls back to doc-index.json when DB retrieval is unavailable, and returns matched evidence plus bounded document content."),
51
+
mcp.WithDescription("Retrieve relevant generated docs for a natural-language or multi-keyword query. Uses DB-backed graph evidence and returns matched evidence plus bounded document content."),
52
52
mcp.WithString("query", mcp.Description("Natural-language or multi-keyword retrieval query"), mcp.Required()),
53
53
mcp.WithNumber("limit", mcp.Description("Maximum number of document results (default: 5, max: 50)")),
54
54
mcp.WithNumber("content_limit", mcp.Description("Maximum bytes of Markdown content per result (default: 4000, max: 20000; use 0 to omit content)")),
55
-
mcp.WithString("namespace", mcp.Description("Namespace. When set, retrieves from that namespace's DB rows or namespace-specific doc-index.json fallback.")),
55
+
mcp.WithString("namespace", mcp.Description("Namespace. When set, retrieves from that namespace's DB rows and generated docs.")),
56
56
mcp.WithBoolean("explain", mcp.Description("When true, include available per-result diagnostics such as field_scores, literal_score, expanded_terms, and expansion_score (default: false).")),
0 commit comments