cortex-local 2.1.14__tar.gz → 2.1.16__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cortex_local-2.1.14 → cortex_local-2.1.16}/PKG-INFO +1 -1
- {cortex_local-2.1.14 → cortex_local-2.1.16}/cortex/mcp_server.py +17 -0
- {cortex_local-2.1.14 → cortex_local-2.1.16}/README.md +0 -0
- {cortex_local-2.1.14 → cortex_local-2.1.16}/cortex/__init__.py +0 -0
- {cortex_local-2.1.14 → cortex_local-2.1.16}/cortex/cli.py +0 -0
- {cortex_local-2.1.14 → cortex_local-2.1.16}/cortex/config.py +0 -0
- {cortex_local-2.1.14 → cortex_local-2.1.16}/cortex/core/__init__.py +0 -0
- {cortex_local-2.1.14 → cortex_local-2.1.16}/cortex/core/cache.py +0 -0
- {cortex_local-2.1.14 → cortex_local-2.1.16}/cortex/core/chunker.py +0 -0
- {cortex_local-2.1.14 → cortex_local-2.1.16}/cortex/core/code_graph.py +0 -0
- {cortex_local-2.1.14 → cortex_local-2.1.16}/cortex/core/global_graph.py +0 -0
- {cortex_local-2.1.14 → cortex_local-2.1.16}/cortex/core/graph.py +0 -0
- {cortex_local-2.1.14 → cortex_local-2.1.16}/cortex/core/notes_graph.py +0 -0
- {cortex_local-2.1.14 → cortex_local-2.1.16}/cortex/embedder.py +0 -0
- {cortex_local-2.1.14 → cortex_local-2.1.16}/cortex/indexer.py +0 -0
- {cortex_local-2.1.14 → cortex_local-2.1.16}/cortex/state.py +0 -0
- {cortex_local-2.1.14 → cortex_local-2.1.16}/pyproject.toml +0 -0
|
@@ -21,6 +21,16 @@ from .indexer import index_path
|
|
|
21
21
|
|
|
22
22
|
mcp = FastMCP("cortex")
|
|
23
23
|
|
|
24
|
+
|
|
25
|
+
def _log_search(tool: str, query: str, top: list) -> None:
|
|
26
|
+
try:
|
|
27
|
+
entry = {"ts": time.time(), "tool": tool, "query": query, "top": top}
|
|
28
|
+
with open(data_dir() / "search_log.jsonl", "a") as f:
|
|
29
|
+
f.write(json.dumps(entry) + "\n")
|
|
30
|
+
except Exception:
|
|
31
|
+
pass
|
|
32
|
+
|
|
33
|
+
|
|
24
34
|
_reindex_state: dict = {
|
|
25
35
|
"running": False, "started_at": None, "output": [], "error": None, "done": False,
|
|
26
36
|
}
|
|
@@ -119,6 +129,9 @@ def search_notes(query: str, limit: int = 5) -> str:
|
|
|
119
129
|
parts.append(f"**{p['file']} > {p['heading']}** (score: {round(r.score, 3)}){tag_str}\n\n{p['text']}")
|
|
120
130
|
matched_files.append(p.get("file", ""))
|
|
121
131
|
matched_scores.append(r.score)
|
|
132
|
+
_log_search("search_notes", query, [
|
|
133
|
+
{"file": f, "score": round(s, 3)} for f, s in zip(matched_files, matched_scores)
|
|
134
|
+
])
|
|
122
135
|
ppr = _ppr_block(matched_files, matched_scores)
|
|
123
136
|
if ppr:
|
|
124
137
|
parts.append(ppr)
|
|
@@ -175,6 +188,10 @@ def search_code(query: str, limit: int = 5) -> str:
|
|
|
175
188
|
if len(deduped) >= limit:
|
|
176
189
|
break
|
|
177
190
|
_stats["total_results_code"] += len(deduped)
|
|
191
|
+
_log_search("search_code", query, [
|
|
192
|
+
{"repo": r.payload.get("repo", ""), "file": r.payload.get("file", ""), "score": round(bs, 3)}
|
|
193
|
+
for bs, r, _ in deduped
|
|
194
|
+
])
|
|
178
195
|
parts = []
|
|
179
196
|
for boosted_score, r, file_meta in deduped:
|
|
180
197
|
p = r.payload
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|