nano-brain 2026.6.2 → 2026.6.4
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.
- package/package.json +1 -1
- package/src/harvester.ts +7 -2
- package/src/llm-provider.ts +1 -1
- package/src/server.ts +9 -2
- package/src/types.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nano-brain",
|
|
3
|
-
"version": "2026.6.
|
|
3
|
+
"version": "2026.6.4",
|
|
4
4
|
"description": "Persistent memory and code intelligence for AI coding agents. Local MCP server with self-learning hybrid search (BM25 + vector + knowledge graph + LLM reranking), automatic session ingestion, codebase indexing, and 22 tools. Learns your preferences over time. Works with OpenCode, Claude, Cursor, Windsurf, and any MCP client.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/src/harvester.ts
CHANGED
|
@@ -315,8 +315,13 @@ async function harvestFromDb(
|
|
|
315
315
|
if (sessionIndex % 5 === 0) await yieldToEventLoop();
|
|
316
316
|
|
|
317
317
|
if (state[sessionId]?.skipped) {
|
|
318
|
-
|
|
319
|
-
|
|
318
|
+
if (state[sessionId].mtime >= session.time_updated) {
|
|
319
|
+
skippedCount++;
|
|
320
|
+
continue;
|
|
321
|
+
}
|
|
322
|
+
delete state[sessionId].skipped;
|
|
323
|
+
stateChanged = true;
|
|
324
|
+
log('harvester', 'Re-evaluating previously skipped session ' + sessionId + ' (updated since last check)');
|
|
320
325
|
}
|
|
321
326
|
|
|
322
327
|
if (
|
package/src/llm-provider.ts
CHANGED
|
@@ -112,7 +112,7 @@ export class GitlabDuoLLMProvider implements LLMProvider {
|
|
|
112
112
|
export function createLLMProvider(config: ConsolidationConfig): LLMProvider | null {
|
|
113
113
|
const apiKey = config.apiKey || process.env.CONSOLIDATION_API_KEY;
|
|
114
114
|
const endpoint = config.endpoint || 'https://ai-proxy.thnkandgrow.com';
|
|
115
|
-
const model = config.model || '
|
|
115
|
+
const model = config.model || 'gitlab/claude-haiku-4-5';
|
|
116
116
|
const provider = config.provider;
|
|
117
117
|
|
|
118
118
|
const isOllama = provider === 'ollama' || endpoint.includes('/api/generate');
|
package/src/server.ts
CHANGED
|
@@ -783,6 +783,7 @@ export function createMcpServer(deps: ServerDeps): McpServer {
|
|
|
783
783
|
const effectiveProjectHash = wsResult.projectHash
|
|
784
784
|
const effectiveWorkspaceRoot = wsResult.workspaceRoot
|
|
785
785
|
const effectiveStore = wsResult.store
|
|
786
|
+
let asyncCategorizationPending = false;
|
|
786
787
|
|
|
787
788
|
try {
|
|
788
789
|
const date = new Date().toISOString().split('T')[0];
|
|
@@ -910,13 +911,19 @@ export function createMcpServer(deps: ServerDeps): McpServer {
|
|
|
910
911
|
const llmProviderForCategorization = createLLMProvider(consolidationConfig as ConsolidationConfig);
|
|
911
912
|
if (llmProviderForCategorization) {
|
|
912
913
|
const capturedDocId = docId;
|
|
914
|
+
const tagStore = effectiveStore;
|
|
915
|
+
asyncCategorizationPending = true;
|
|
913
916
|
categorizeMemory(content, llmProviderForCategorization, categorizationConfig).then(llmTags => {
|
|
914
917
|
if (llmTags.length > 0) {
|
|
915
|
-
|
|
918
|
+
tagStore.insertTags(capturedDocId, llmTags);
|
|
916
919
|
log('mcp', 'LLM categorization complete: ' + llmTags.join(', '));
|
|
917
920
|
}
|
|
918
921
|
}).catch(err => {
|
|
919
922
|
log('mcp', 'LLM categorization failed: ' + (err instanceof Error ? err.message : String(err)));
|
|
923
|
+
}).finally(() => {
|
|
924
|
+
if (wsResult.needsClose) {
|
|
925
|
+
try { tagStore.close(); } catch {}
|
|
926
|
+
}
|
|
920
927
|
});
|
|
921
928
|
}
|
|
922
929
|
}
|
|
@@ -930,7 +937,7 @@ export function createMcpServer(deps: ServerDeps): McpServer {
|
|
|
930
937
|
],
|
|
931
938
|
};
|
|
932
939
|
} finally {
|
|
933
|
-
if (wsResult.needsClose) {
|
|
940
|
+
if (wsResult.needsClose && !asyncCategorizationPending) {
|
|
934
941
|
wsResult.store.close()
|
|
935
942
|
}
|
|
936
943
|
}
|
package/src/types.ts
CHANGED
|
@@ -318,7 +318,7 @@ export interface ConsolidationConfig {
|
|
|
318
318
|
export const DEFAULT_CONSOLIDATION_CONFIG: ConsolidationConfig = {
|
|
319
319
|
enabled: false,
|
|
320
320
|
interval_ms: 3600000,
|
|
321
|
-
model: '
|
|
321
|
+
model: 'gitlab/claude-haiku-4-5',
|
|
322
322
|
endpoint: 'https://ai-proxy.thnkandgrow.com',
|
|
323
323
|
max_memories_per_cycle: 20,
|
|
324
324
|
min_memories_threshold: 2,
|
|
@@ -335,7 +335,7 @@ export interface ExtractionConfig {
|
|
|
335
335
|
|
|
336
336
|
export const DEFAULT_EXTRACTION_CONFIG: ExtractionConfig = {
|
|
337
337
|
enabled: false,
|
|
338
|
-
model: '
|
|
338
|
+
model: 'gitlab/claude-haiku-4-5',
|
|
339
339
|
endpoint: 'https://ai-proxy.thnkandgrow.com',
|
|
340
340
|
maxFactsPerSession: 20,
|
|
341
341
|
};
|