obol-ai 0.3.48 → 0.3.49

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "obol-ai",
3
- "version": "0.3.48",
3
+ "version": "0.3.49",
4
4
  "description": "Self-evolving AI assistant that learns, remembers, and acts on its own. Persistent vector memory, self-rewriting personality, proactive heartbeats.",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -14,7 +14,7 @@ function buildRouterMessages(recentHistory, userMessage) {
14
14
  return [...trimmed, { role: 'user', content: userMessage }];
15
15
  }
16
16
 
17
- function extractRecentUserMessages(recentHistory, userMessage, count = 5) {
17
+ function buildConversationQueries(recentHistory, userMessage, count = 5) {
18
18
  const userMsgs = recentHistory
19
19
  .filter(m => m.role === 'user')
20
20
  .map(m => typeof m.content === 'string'
@@ -22,8 +22,12 @@ function extractRecentUserMessages(recentHistory, userMessage, count = 5) {
22
22
  : m.content.filter(b => b.type === 'text').map(b => b.text).join(''))
23
23
  .filter(Boolean)
24
24
  .slice(-count);
25
- userMsgs.push(userMessage);
26
- return userMsgs;
25
+
26
+ const queries = [userMessage];
27
+ if (userMsgs.length > 0) {
28
+ queries.push([...userMsgs, userMessage].join('\n'));
29
+ }
30
+ return queries;
27
31
  }
28
32
 
29
33
  function tokenize(s) {
@@ -85,8 +89,8 @@ If recent context shows an ongoing task (sonnet/opus was just used, multi-step w
85
89
 
86
90
  if (decision.need_memory && memory) {
87
91
  const budget = decision.model === 'opus' ? 60 : 40;
88
- const poolPerQuery = decision.model === 'opus' ? 25 : 20;
89
- const conversationQueries = extractRecentUserMessages(recentHistory, userMessage);
92
+ const poolPerQuery = decision.model === 'opus' ? 40 : 30;
93
+ const conversationQueries = buildConversationQueries(recentHistory, userMessage);
90
94
 
91
95
  const semanticResults = await Promise.all(
92
96
  conversationQueries.map(q => memory.search(q, { limit: poolPerQuery, threshold: 0.4 }))