Skip to content

Commit fa9935c

Browse files
committed
Simplified entity prompt. Guidelines were restrictive.
1 parent 33574c1 commit fa9935c

File tree

1 file changed

+3
-11
lines changed
  • libs/langchain-mongodb/langchain_mongodb/graphrag

1 file changed

+3
-11
lines changed

libs/langchain-mongodb/langchain_mongodb/graphrag/prompts.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,9 @@
66

77
ENTITY_EXTRACTION_INSTRUCTIONS = """
88
## Overview
9-
You are a meticulous analyst tasked with extracting information from unstructured text
9+
You are a meticulous analyst tasked with identifying potential entities from unstructured text
1010
to build a knowledge graph in a structured json format of entities (nodes) and their relationships (edges).
11-
The graph will be stored in a MongoDB Collection and traversed using $graphLookup
12-
from starting points of entity nodes matching names found in a query, and follow their relationships.
13-
14-
Use the following as guidelines.
15-
16-
- Simplicity: The graph should have as few entities and relationship types as needed to convey the information in the input.
17-
- Consistency: Connections can only be made if entities and relationships use consistent naming.
18-
- Generality: The graph should be useful for describing the concepts in not just this document but other similar documents.
19-
- Accuracy: Do not add any information that is not explicitly mentioned in the text.
11+
**Include as many entities and relationships as you can.**
2012
2113
INPUT: You will be provided a text document.
2214
OUTPUT:
@@ -92,8 +84,8 @@
9284
or human-readable identifiers, found in the text.
9385
9486
**Allowed Entity Types**:
87+
- By default, all types are permitted.
9588
- If a non-empty list is provided, extract ONLY entities whose `type` matches one of the following: [{allowed_entity_types}].
96-
- NOTE: If this list is empty, anything is permitted.
9789
9890
### Examples of Exclusions:
9991
- If `allowed_entity_types` is `["Person", "Organization"]`, and the text mentions an "Event" or "Location",

0 commit comments

Comments
 (0)