@easbot/agent 0.1.13 → 0.1.15

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/README.en.md CHANGED
@@ -1,3 +1,5 @@
1
+ [中文](./README.md) | English
2
+
1
3
  # @easbot/agent
2
4
 
3
5
  EASBot Agent - Core Runtime for Multi-Agent Collaboration Ecosystem
@@ -17,11 +19,7 @@ EASBot Agent - Core Runtime for Multi-Agent Collaboration Ecosystem
17
19
  ## Installation
18
20
 
19
21
  ```bash
20
- # Global installation
21
- npm install -g @easbot/agent
22
-
23
- # Or using pnpm
24
- pnpm add -g @easbot/agent
22
+ # pnpm add @easbot/agent
25
23
  ```
26
24
 
27
25
  ## Quick Start
package/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [English](./README.en.md) | 中文
2
+
1
3
  # @easbot/agent
2
4
 
3
5
  EASBot Agent - 多Agent协作生态系统的核心运行时
@@ -17,11 +19,7 @@ EASBot Agent - 多Agent协作生态系统的核心运行时
17
19
  ## 安装
18
20
 
19
21
  ```bash
20
- # 全局安装
21
- npm install -g @easbot/agent
22
-
23
- # 或使用 pnpm
24
- pnpm add -g @easbot/agent
22
+ # pnpm add @easbot/agent
25
23
  ```
26
24
 
27
25
  ## 快速开始
@@ -1,12 +1,16 @@
1
1
  # Knowledge Graph Summary Prompt
2
- # Generates ONE combined summary from MULTIPLE knowledge graph entities
3
2
 
4
3
  ## Task
5
- You will receive MULTIPLE knowledge graph entities. Generate ONE combined summary covering ALL of them.
4
+ Generate ONE combined summary from MULTIPLE knowledge graph entities.
6
5
 
7
- ## Input Format
8
- You will receive multiple knowledge graph entities in the following format:
6
+ **CRITICAL RULES:**
7
+ - NEVER generate relationships not present in the input
8
+ - NEVER invent connections or attributes
9
+ - NEVER elaborate beyond provided information
10
+ - NEVER guess entity properties
11
+ - If input has no valuable information: ONLY output "No relevant knowledge found."
9
12
 
13
+ ## Input Format
10
14
  ```
11
15
  [Entity 1]
12
16
  Entity: {entity1}
@@ -17,44 +21,34 @@ Relation Types: {relation_types1}
17
21
 
18
22
  [Entity 2]
19
23
  Entity: {entity2}
20
- Type: {entity_type2}
21
- Description: {description2}
22
- Related Entities: {related_entities2}
23
- Relation Types: {relation_types2}
24
-
25
- ... (more entities)
24
+ ...
26
25
  ```
27
26
 
28
- ## Output Requirements
29
- - Generate ONE combined summary covering ALL input entities
30
- - Use markdown format with clear sections
31
- - Group information by entity
32
- - Highlight core attributes and key relationships
33
- - Mark information source as "Knowledge Graph"
34
- - Keep concise but comprehensive - cover all entities
35
-
36
27
  ## Output Format
37
- Use markdown structure:
28
+ **Length: 1-3 entities maximum**
29
+ - Lead with most relevant entities
30
+ - Group information clearly
31
+ - Cite source as "Knowledge Graph"
38
32
 
39
33
  ```markdown
40
- ## [Entity: entity_name]
41
- - **Type:** entity_type
42
- - **Source:** Knowledge Graph
43
- - **Description:** Description text...
44
- - **Related Entities:**
45
- - {related_entity1}: {relation_type1}
46
- - {related_entity2}: {relation_type2}
47
-
48
- ## [Entity: another_entity]
49
- - **Type:** another_type
50
- - **Source:** Knowledge Graph
51
- - **Description:** ...
52
- - **Related Entities:**
53
- - ...
34
+ ## [Entity Name] (Priority: {priority})
35
+ **Type:** {entity_type}
36
+ **Source:** Knowledge Graph
37
+ **Description:** ...
38
+ **Related Entities:**
39
+ [{relation}] {target_entity}
40
+ ```
41
+
42
+ ## Fixed Response
43
+ If entities are irrelevant or insufficient:
44
+ ```
45
+ No relevant knowledge found.
54
46
  ```
47
+ **DO NOT generate any other content.**
55
48
 
56
49
  ## Rules
57
- - Output ONE combined summary, not separate summaries per entity
58
- - Use markdown headers to separate entities
59
- - Sort relationships by relevance
60
- - If information is insufficient, mark as "No relevant information in graph"
50
+ - Output ONE combined summary only
51
+ - Never separate summaries per entity
52
+ - Never invent attributes or relationships
53
+ - Never exceed provided information
54
+ - If uncertain: "No relevant knowledge found."
@@ -1,40 +1,81 @@
1
- # Knowledge Summary Prompt
2
-
3
- ## Task
4
- Synthesize the provided document chunks into ONE concise, structured summary relevant to the query.
5
- Each chunk has a pre-computed **Priority** score (0-1). Use it as the sole ordering signal.
6
-
7
- ## Priority Score
8
- Priority = 0.70 × relevance + 0.30 × recency
9
-
10
- Higher Priority = more relevant to the query and more recently updated.
11
- Relevance is the dominant factor (70%). Recency is a tiebreaker (30%).
12
- Chunks with Priority > 0.6 are high-priority. Chunks < 0.3 are low-priority.
13
-
14
- ## Input Format
15
- [Chunk N] Priority: {priority}
16
- Source: [filename](./filename#Lstart-Lend)
17
- {content}
18
- Graph Nodes:
19
- Node: {name} ({type}) | {properties}
20
- --[{relation}]--> {targetName} ({targetType})
21
-
22
- ## Output
23
-
24
- ### Content Summary
25
- 3-5 sentences. Lead with highest-priority chunks.
26
- Cite sources: [{filename}](./{filename}#Lstart-Lend)
27
- Include lower-priority chunks only if they add unique value.
28
-
29
- ### Entity & Relation Map (only if graph nodes are present)
30
- Deduplicate nodes by name, merge relations across all chunks:
31
- **{EntityName}** ({type})
32
- [{relation}] {TargetEntity} ({targetType})
33
-
34
- ### Key Insights (only if meaningful patterns exist)
35
- 1-3 bullets on notable patterns or connections across chunks.
36
-
37
- ## Rules
38
- - Skip sections with no data
39
- - Base output only on provided content, do not invent facts
40
- - If no relevant information: "No relevant knowledge found."
1
+ # Knowledge Summary Prompt
2
+
3
+ ## Task
4
+ Synthesize document chunks into a concise summary relevant to the query.
5
+
6
+ **CRITICAL RULES:**
7
+ - NEVER generate content not present in the input
8
+ - NEVER invent relationships or connections
9
+ - NEVER elaborate beyond provided information
10
+ - NEVER guess or assume user needs
11
+ - If input has no valuable information: ONLY output "No relevant knowledge found."
12
+
13
+ ## Priority Score
14
+ Priority = 0.6 × relevance + 0.4 × recency
15
+ - Priority > 0.6: high-priority (include)
16
+ - Priority < 0.3: low-priority (skip unless unique value)
17
+
18
+ ## Input Format
19
+ [Chunk N] Priority: {priority}
20
+ Source: [{filename}](./{filename}#{startLine}-{endLine})
21
+ {content}
22
+ Graph Nodes:
23
+ Node: {name} ({type}) | {properties}
24
+ [{relation}] → target={targetType}:{targetName}
25
+
26
+ ## Output Format
27
+
28
+ ### Content Summary (REQUIRED)
29
+ **Length: 1-3 sentences maximum**
30
+ - Lead with highest-priority chunks ONLY
31
+ - Skip chunks Priority < 0.3
32
+ - Include lower-priority chunks only if they add unique value
33
+ - Cite sources: [{filename}](./{filename}#{startLine})
34
+
35
+ ### Entity & Relation Map (CONDITIONAL)
36
+ Only include if:
37
+ 1. Graph nodes are present AND
38
+ 2. They add meaningful connections not in Content Summary
39
+
40
+ Format:
41
+ **{EntityName}** ({type})
42
+ → [{relation}] → {TargetEntity} ({targetType})
43
+
44
+ ### Key Insights (CONDITIONAL)
45
+ Only include if:
46
+ 1. Notable patterns exist AND
47
+ 2. They are NOT already covered in Content Summary
48
+
49
+ Format:
50
+ - 1-2 bullets maximum
51
+
52
+ ## Fixed Response
53
+ If no chunks have Priority > 0.3 or all chunks are irrelevant:
54
+ ```
55
+ No relevant knowledge found.
56
+ ```
57
+ **DO NOT generate any other content.**
58
+
59
+ ## Examples
60
+
61
+ ### Good Output (relevant chunks)
62
+ ```
63
+ The codebase uses React for frontend (Priority: 0.78).
64
+ Source: [frontend/index.tsx](./frontend/index.tsx#L10-L50)
65
+ ```
66
+
67
+ ### Bad Output (NEVER generate)
68
+ ```
69
+ Hello! Based on the documents, I can help you with React setup.
70
+ The project structure follows a standard pattern.
71
+ You should use TypeScript for type safety.
72
+ ```
73
+ (These weren't in the input!)
74
+
75
+ ## Strict Rules
76
+ - Output ONLY content from input chunks
77
+ - Skip all sections with no data
78
+ - Maximum 3 sentences in Content Summary
79
+ - NEVER exceed provided information
80
+ - Cite sources when including facts
81
+ - If uncertain: "No relevant knowledge found."
@@ -1,40 +1,80 @@
1
- # Memory Summary Prompt
2
-
3
- ## Task
4
- Synthesize the provided memory facts into ONE concise, structured summary relevant to the query.
5
- Each fact has a pre-computed **Priority** score (0-1). Use it as the sole ordering signal.
6
-
7
- ## Priority Score
8
- Priority = 0.35 × relevance + 0.35 × recency + 0.30 × importance_normalized
9
-
10
- Higher Priority = more relevant, more recent, and more important.
11
- Facts with Priority > 0.6 are high-priority. Facts < 0.3 are low-priority.
12
- When a high-priority fact contradicts a low-priority one, the high-priority fact is the current truth.
13
-
14
- ## Input Format
15
- [Fact N] Priority: {priority}
16
- Category: {category} | Importance: {importance} | Source: {source}
17
- {content}
18
- Graph Nodes:
19
- Node: {name} ({type})
20
- --[{relation}]--> {targetName} ({targetType})
21
-
22
- ## Output
23
-
24
- ### Content Summary
25
- 2-4 sentences. Lead with highest-priority facts.
26
- Include lower-priority facts only if they add unique value not covered by higher-priority ones.
27
- If a high-priority fact updates or contradicts a lower-priority one, state the current truth clearly.
28
-
29
- ### Entity & Relation Map (only if graph nodes are present)
30
- Deduplicate nodes by name, merge relations across all facts:
31
- **{EntityName}** ({type})
32
- [{relation}] {TargetEntity} ({targetType})
33
-
34
- ### Key Insights (only if meaningful patterns exist)
35
- 1-2 bullets. Highlight contradictions between high and low priority facts.
36
-
37
- ## Rules
38
- - Skip sections with no data
39
- - Base output only on provided content, do not invent facts
40
- - If no relevant information: "No relevant memory found."
1
+ # Memory Summary Prompt
2
+
3
+ ## Task
4
+ Synthesize memory facts into a concise summary relevant to the query.
5
+
6
+ **CRITICAL RULES:**
7
+ - NEVER generate facts not present in the input
8
+ - NEVER invent content or relationships
9
+ - NEVER elaborate beyond provided information
10
+ - NEVER guess or assume user intent
11
+ - If input has no valuable information: ONLY output "No relevant memory found."
12
+
13
+ ## Priority Score
14
+ Priority = 0.4 × relevance + 0.3 × recency + 0.3 × importance
15
+ - Priority > 0.6: high-priority (include)
16
+ - Priority < 0.3: low-priority (skip unless unique value)
17
+
18
+ ## Input Format
19
+ [Fact N] Priority: {priority}
20
+ Category: {category} | Importance: {importance} | Source: {source}
21
+ {content}
22
+ Graph Nodes:
23
+ Node: {name} ({type})
24
+ [{relation}] → target={targetType}:{targetName}
25
+
26
+ ## Output Format
27
+
28
+ ### Content Summary (REQUIRED)
29
+ **Length: 1-3 sentences maximum**
30
+ - Lead with highest-priority facts ONLY
31
+ - Skip facts Priority < 0.3
32
+ - Include low-priority facts only if they add unique value not in high-priority facts
33
+ - State contradictions clearly: "High-priority fact X contradicts low-priority fact Y. Current truth: X."
34
+
35
+ ### Entity & Relation Map (CONDITIONAL)
36
+ Only include if:
37
+ 1. Graph nodes are present AND
38
+ 2. They add meaningful connections not in Content Summary
39
+
40
+ Format:
41
+ **{EntityName}** ({type})
42
+ → [{relation}] → {TargetEntity} ({targetType})
43
+
44
+ ### Key Insights (CONDITIONAL)
45
+ Only include if:
46
+ 1. Meaningful patterns exist AND
47
+ 2. They are NOT already covered in Content Summary
48
+
49
+ Format:
50
+ - 1-2 bullets maximum
51
+
52
+ ## Fixed Response
53
+ If no facts have Priority > 0.3 or all facts are irrelevant:
54
+ ```
55
+ No relevant memory found.
56
+ ```
57
+ **DO NOT generate any other content.**
58
+
59
+ ## Examples
60
+
61
+ ### Good Output (relevant facts)
62
+ ```
63
+ The user prefers dark mode (Priority: 0.72).
64
+ High-priority fact contradicts earlier light mode preference.
65
+ ```
66
+
67
+ ### Bad Output (NEVER generate)
68
+ ```
69
+ Hello! I can help you with dark mode settings.
70
+ The user's name is John and they work at Company X.
71
+ They like TypeScript and use VSCode daily.
72
+ ```
73
+ (These facts weren't in the input!)
74
+
75
+ ## Strict Rules
76
+ - Output ONLY facts from input
77
+ - Skip all sections with no data
78
+ - Maximum 3 sentences in Content Summary
79
+ - NEVER exceed provided information
80
+ - If uncertain: "No relevant memory found."