[geaflow/ai-memory] Implement schema-first property graph extraction prompt builder
- Dominant language
- Java
- Stars
- 808
- Forks
- 188
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 2
Description
Priority: P1
Difficulty: Intermediate
Context: Later LLM extraction needs consistent prompts, but prompt construction should be isolated from model clients. This issue provides prompt generation, not model execution.
Scope:
- Add `ExtractionPromptBuilder`.
- Generate prompt sections for schema, allowed entity types, allowed relation types, examples, and output JSON format.
- Add golden prompt tests.
Constraints:
- No remote model call.
- Prompt must include strict JSON output requirement and source span requirement.
- Prompt must not include unrelated schemas.
Acceptance Criteria:
- Prompt output is deterministic for the same schema and examples.
- Golden tests cover English, Chinese, and mixed text.
- Prompt builder rejects schema with no vertex or edge definitions.
Suggested paths:
- `geaflow-ai/src/main/java/org/apache/geaflow/ai/extract/prompt`
Contributor guide
Research direction
Start in geaflow-ai/src/main/java/org/apache/geaflow/ai/extract/prompt and identify the prompt-builder entry point and nearby schema types. Add golden prompt tests covering English, Chinese, and mixed text, then verify deterministic output, strict JSON and source-span requirements, rejection of schemas without vertex or edge definitions, and exclusion of unrelated schemas.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- ai
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100