@voidwire/lore 1.8.1 → 1.8.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/lib/contradiction.ts +7 -5
- package/lib/indexers/personal.ts +7 -6
- package/package.json +1 -1
package/lib/contradiction.ts
CHANGED
|
@@ -78,7 +78,6 @@ export async function findCandidates(
|
|
|
78
78
|
|
|
79
79
|
return hybridSearch(content, {
|
|
80
80
|
source,
|
|
81
|
-
project: topic || undefined,
|
|
82
81
|
limit: CANDIDATE_LIMIT,
|
|
83
82
|
});
|
|
84
83
|
}
|
|
@@ -110,10 +109,13 @@ export async function classifyContradiction(
|
|
|
110
109
|
.map((c) => `[rowid: ${c.rowid}] ${c.content}`)
|
|
111
110
|
.join("\n");
|
|
112
111
|
|
|
113
|
-
const systemPrompt = `You
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
112
|
+
const systemPrompt = `You deduplicate knowledge entries. Your job is to prevent storing the same insight multiple times.
|
|
113
|
+
|
|
114
|
+
Reply NOOP if the new entry means the same thing as ANY existing entry — even if the words are different.
|
|
115
|
+
Reply DELETE <rowid> if the new entry is a better version of an existing entry.
|
|
116
|
+
Reply ADD only if the new entry contains a genuinely novel insight not present in any existing entry.
|
|
117
|
+
|
|
118
|
+
When in doubt, reply NOOP. Redundancy is worse than missing an entry.`;
|
|
117
119
|
|
|
118
120
|
const userPrompt = `New entry (source: ${source}, topic: ${topic}):
|
|
119
121
|
${content}
|
package/lib/indexers/personal.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* lib/indexers/personal.ts - Personal data indexer
|
|
3
3
|
*
|
|
4
4
|
* Reads JSON files from the personal data directory and indexes
|
|
5
|
-
* 8 types: book,
|
|
5
|
+
* 8 types: book, contact, movie, podcast, interest, habit, profile, preference.
|
|
6
6
|
*
|
|
7
7
|
* Source: personal
|
|
8
8
|
* Topic: (empty - type handles categorization)
|
|
@@ -31,10 +31,11 @@ Keep under 80 words. Output only the description, no headers or formatting.`;
|
|
|
31
31
|
|
|
32
32
|
const ENRICH_PROMPTS: Record<string, string> = {
|
|
33
33
|
person: `You are enriching a personal contact entry for search indexing.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
Example: relationship
|
|
37
|
-
Example: relationship
|
|
34
|
+
Generate a natural language description that includes the person's name and their relationship.
|
|
35
|
+
Include synonyms for the relationship naturally in the sentence.
|
|
36
|
+
Example: {"name":"Mike","relationship":"uncle"} → Mike is an uncle, a family member and relative on the parent's side.
|
|
37
|
+
Example: {"name":"Jade","relationship":"child"} → Jade is a child, a kid and offspring in the family.
|
|
38
|
+
Example: {"name":"Sansa","relationship":"cat"} → Sansa is a cat, a pet and feline companion in the household.
|
|
38
39
|
${ENRICH_SHARED}`,
|
|
39
40
|
book: `You are enriching a book entry for search indexing.
|
|
40
41
|
Generate: genre, themes, and related topics based on the title.
|
|
@@ -152,7 +153,7 @@ export async function indexPersonal(ctx: IndexerContext): Promise<void> {
|
|
|
152
153
|
title: person.name,
|
|
153
154
|
content,
|
|
154
155
|
topic: "",
|
|
155
|
-
type: "
|
|
156
|
+
type: "contact",
|
|
156
157
|
timestamp: peopleTs,
|
|
157
158
|
metadata: { name: person.name },
|
|
158
159
|
});
|