You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Phase 1 should turn the current geaflow-ai prototype into a reproducible Graph Memory reference implementation. The goal is not to copy HugeGraph-AI component names, Gremlin, Faiss, or any specific Python stack. The goal is to provide a user-visible loop:
Import raw or pre-structured knowledge.
Split documents into chunks with stable provenance.
Extract schema-first property graph facts.
Validate, normalize, quarantine, and write graph facts.
Build chunk, entity-vector, and keyword indexes.
Support Basic, Vector, Graph, and Hybrid retrieval modes.
Safely translate natural language into constrained GQL or fall back to bounded traversal.
Fuse evidence and synthesize citation-aware answers.
Expose REST/Function Tool contracts with trace, metrics, and run state.
The current code already has valuable anchors: TextFileReader, ModelUtils.splitLongText, GraphEntity, MemoryGraph, GraphMemoryServer, EmbeddingIndexStore, KeywordVector, EmbeddingVector, ChatService, REST/CLI entry points, and a separate geaflow-mcp query tool surface. The missing work is contract, lifecycle, verification, safety, and composable retrieval behavior.
Design rule: every issue below must either freeze a contract, add a deterministic fixture, or implement a small replaceable component. Avoid PRs that mix extraction, storage, retrieval, answer generation, and API changes in one branch.
good first issue only when the issue has stable acceptance criteria and does not require architecture decisions.
Definition of Ready:
The issue has one owner/sponsor and one backup reviewer.
The issue lists affected paths and non-goals.
The issue can be verified offline without external model credentials, or it provides a deterministic fake model provider.
The issue does not change public contracts silently.
The issue does not commit private text, tokens, large datasets, or unlicensed data.
4. Issue Body Template
## Context
Describe the current geaflow-ai behavior and why this issue matters for Graph Memory Phase 1.
## Scope
List the files, interfaces, tests, docs, or fixtures this issue may change.
## Non-goals
State what must not be solved here.
## Constraints- Offline CI must not require remote LLM or embedding credentials.
- Output must be deterministic or have an explicit tolerance/property oracle.
- Public contract changes require maintainer review.
## Acceptance Criteria-[ ] Contract or behavior is documented.
-[ ] Success, empty, invalid, and boundary cases are covered.
-[ ] Tests or golden fixtures can run from repository root.
-[ ] Error messages are actionable and do not leak secrets or raw private text.
## Suggested Paths-`geaflow-ai/...`-`geaflow-mcp/...`
5. Atomic Issue List
Track A. Document Ingestion and Chunk Lifecycle
GM-AI-P1-001: Define DocumentSource and DocumentRecord contracts
Context: TextFileReader currently reads non-empty lines into strings. Graph Memory Phase 1 needs a stable document boundary before chunking, extraction, indexing, and replay can be deterministic.
Scope:
Add contract classes for DocumentSource, DocumentRecord, and SourceRef.
Include fields such as source_id, uri, media_type, charset, content_hash, created_at, ingested_at, and metadata.
Add tests for empty files, duplicate source IDs, Unicode content, and stable content hash.
Constraints:
Do not replace all existing readers in this issue.
Do not add remote storage support.
Do not store raw private text in logs.
Acceptance Criteria:
A document loaded twice with the same content receives the same content_hash.
Invalid or missing source metadata fails with a typed validation error.
Context: ModelUtils.splitLongText can split long strings, but it does not create stable chunk IDs, offsets, source references, or replay semantics. Chunk identity is required for chunk vector retrieval and citation-aware answers.
Scope:
Add Chunker interface and a default text chunker.
Add ChunkRecord with chunk_id, source_ref, ordinal, start_offset, end_offset, text_hash, policy_version.
Add golden tests for Chinese, English, mixed punctuation, CRLF, blank lines, and long paragraphs.
Constraints:
Do not call embedding services.
Do not decide extraction schema in this issue.
Chunk IDs must not depend on wall-clock time.
Acceptance Criteria:
Same document + same chunk policy produces identical chunk IDs across runs.
Changing chunk policy changes policy_version and expected chunk IDs.
Empty input produces an explicit empty result, not null.
GM-AI-P1-003: Add document replay and deduplication fixtures
Priority: P1
Difficulty: Starter
Context: Graph Memory needs replayable ingestion. If the same document is imported twice, downstream graph facts and indexes should not duplicate silently.
Scope:
Add fixtures for duplicate documents, updated documents, deleted documents, and reordered files.
Define expected replay behavior for source_id + content_hash.
Add tests that only verify replay metadata, not full extraction.
Constraints:
No graph backend implementation in this issue.
No deletion propagation implementation yet; only define fixture and expected state.
Acceptance Criteria:
Fixture clearly distinguishes duplicate, update, and delete events.
Replay metadata can be used by later Event Log and projector issues.
Suggested paths:
geaflow-ai/src/test/resources/document-replay
docs/graphmemory-design-doc.md or a new docs/geaflow-ai-graph-memory-contracts.md
Track B. Schema-First Extraction and KBQA Triple Strategy
GM-AI-P1-004: Define ExtractionSchema for property graph and KBQA triples
Priority: P0
Difficulty: Intermediate
Context: HugeGraph-AI-style import uses schema/prompt-driven extraction. geaflow-ai currently supports pre-structured graph import, but lacks a workflow that converts text paragraphs into typed graph facts or traditional KBQA triples.
Scope:
Add ExtractionSchema contract for vertex types, edge types, properties, aliases, required fields, and allowed relation predicates.
Include a KBQA triple projection: subject, predicate, object, source_span, confidence.
Add JSON examples and parser tests.
Constraints:
Do not implement LLM extraction in this issue.
Do not hard-code a single business ontology.
Schema parsing must fail closed for unknown required fields.
Acceptance Criteria:
Valid schema examples round-trip through JSON.
Invalid relation predicate, missing required property, and duplicate type definitions fail with typed errors.
Schema examples include both property graph and triple-style facts.
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.
GM-AI-P1-009: Add EntityResolver for aliases and canonical IDs
Priority: P0
Difficulty: Intermediate
Context: Extracted entities can mention the same real-world object under different names. Phase 1 needs deterministic canonicalization before graph writes.
Scope:
Add resolver interface and a rule-based resolver.
Support exact alias, normalized text alias, and schema-scoped entity type matching.
Produce canonical_id, alias_used, confidence, and resolution_reason.
Constraints:
No embedding-based resolver in this issue.
Do not merge entities across tenants or schemas.
Low-confidence matches must stay unresolved.
Acceptance Criteria:
Same alias maps to same canonical ID.
Ambiguous alias returns an explicit ambiguous result.
Cross-type alias collision is rejected or scoped correctly.
GM-AI-P1-010: Define provenance model for facts, chunks, and evidence
Priority: P0
Difficulty: Starter
Context: Citation-aware answers and deletion propagation require source lineage. Existing subgraph verbalization does not provide claim-level provenance.
Scope:
Add ProvenanceRef and SourceSpan contracts.
Link extracted facts to document, chunk, extractor version, and schema version.
Add JSON examples.
Constraints:
Do not implement answer generation.
Do not store full raw private text inside provenance objects.
Acceptance Criteria:
Every extracted fact fixture can point back to source document and chunk.
Missing provenance fails validation for extracted facts.
Context: Current main path uses in-process MemoryGraph; GraphComputeEngine is an empty interface. Phase 1 needs a backend boundary so local persistence and a GeaFlow vertical slice can share contracts.
Scope:
Define GraphBackend interface for upsert vertex, upsert edge, delete, scan, get schema, and transaction boundary.
GM-AI-P1-014: Implement local persistent backend prototype
Priority: P1
Difficulty: Intermediate
Context: HugeGraph Server provides persistence in the reference capability. geaflow-ai needs at least a restartable local backend for Phase 1 reference implementation.
Scope:
Implement a simple local backend using append-only JSONL or another existing lightweight local format.
Support restart reload, idempotent upsert, delete marker, and checksum.
Add corruption and partial-write tests.
Constraints:
This is not a distributed backend.
Do not introduce large external dependencies without discussion.
Writes must be recoverable or fail closed.
Acceptance Criteria:
Data survives process restart in tests.
Truncated or malformed local store fails with actionable error or quarantine.
Context: GeaFlow is a streaming graph engine, but geaflow-ai currently cannot treat the main engine as an implemented Graph Memory backend. A vertical slice must be scoped before coding.
Scope:
Write a design document for a minimal GeaFlowBackend slice.
Define supported operations, non-goals, checkpoint behavior, and test strategy.
Map to existing GeaFlow DSL/runtime components.
Constraints:
No production HA claim.
No implementation in this issue.
Must identify exact missing APIs or blockers.
Acceptance Criteria:
Maintainers can decide whether the first slice is read-only, write-through, or projector-based.
Design includes rollback plan and compatibility constraints.
GM-AI-P1-017: Define VectorStore SPI with model metadata
Priority: P0
Difficulty: Intermediate
Context: EmbeddingIndexStore stores embeddings for GraphEntity in JSONL and memory map. Phase 1 needs a generic vector store contract for both chunks and graph entities.
GM-AI-P1-021: Harden keyword index serialization golden tests
Priority: P0
Difficulty: Starter
Context: Keyword retrieval exists through Lucene/keyword vectors, but the main branch behavior has been described as rebuilding during query and vulnerable to noisy common tokens.
Scope:
Add golden tests for keyword tokenization, serialization, reload, Unicode, stopwords, and common-token pollution.
Ensure incremental add/delete expected behavior is documented.
Constraints:
Do not implement a new keyword engine.
Coordinate with any existing resident keyword index PR.
Acceptance Criteria:
Golden tests fail if tokenization or serialization changes unexpectedly.
Common tokens do not dominate exact graph anchoring fixtures.
GM-AI-P1-022: Add searchable watermark for graph, keyword, and vector indexes
Priority: P1
Difficulty: Intermediate
Context: Graph facts and indexes can diverge. Retrieval must know whether graph, keyword, chunk vector, and entity vector projections are searchable for a given import run.
Scope:
Define SearchableWatermark.
Add fields for accepted, validated, graphed, keyword_indexed, chunk_vector_indexed, entity_vector_indexed.
Add tests for partial projection and lag reporting.
Constraints:
Do not implement distributed consistency.
Do not hide partial state; expose it in trace.
Acceptance Criteria:
Retrieval trace can show which projections were available.
Context: Phase 1 needs reproducible routing before any learned router. The router should select retrieval mode based on request flags, query shape, and available indexes.
Scope:
Add RuleRouter.
Preserve user-forced mode.
Add fallback rules for missing chunk index, missing entity index, or graph backend unavailable.
Constraints:
No LLM router.
No learned ranking.
Original query must be preserved in trace.
Acceptance Criteria:
Router decisions are deterministic.
Trace includes reason, selected mode, skipped modes, and fallback reason.
GM-AI-P1-027: Implement EntityAnchorService exact-to-fuzzy state machine
Priority: P0
Difficulty: Intermediate
Context: Keyword hits and embedding candidates exist separately. Phase 1 needs an explicit exact match to fuzzy match state machine for graph anchoring.
Scope:
Add EntityAnchorService.
Try exact keyword/entity alias match first.
Fall back to entity vector fuzzy search.
Return source, score, model version, index version, and failure reason.
Constraints:
Do not execute graph traversal in this issue.
Do not merge entities here; use resolver output.
Acceptance Criteria:
Exact hit, fuzzy hit, no anchor, ambiguous anchor, stale index cases are covered.
Context: geaflow-mcp can execute caller-provided GQL, but Graph Memory needs natural language to constrained GQL. GeaFlow should use GQL/Query IR, not copy a Gremlin-specific design.
Scope:
Add Text2GqlService interface.
Define GraphQueryIR for read-only graph query intents.
Add example-pair index contract for schema-aware generation.
Constraints:
Do not execute generated GQL.
Do not permit write operations in IR.
Public IR requires maintainer review.
Acceptance Criteria:
Fake Text2GQL returns deterministic IR/GQL for fixtures.
Context: Graph/vector/operator results currently update session subgraphs, but there is no unified evidence object for fusion, rerank, answer citation, or abstention.
Context: Hybrid retrieval needs graph/vector merge with score normalization and dedupe. Current operators mutate session state sequentially without a unified fusion contract.
Scope:
Implement Reciprocal Rank Fusion and weighted fusion.
Deduplicate by evidence ID, canonical entity ID, and source span.
Add tests for score ties, duplicate evidence, and missing modality.
Constraints:
Do not add learned reranker.
Fusion must be deterministic.
Acceptance Criteria:
Same inputs always produce same order.
Missing vector or graph modality still returns valid fused evidence with trace.
Context: geaflow-mcp is currently a separate graph query tool surface. It can execute caller-provided GQL, but should not become the core Graph Memory workflow.
Scope:
Write adapter boundary doc.
Explain how MCP should call Graph Memory REST/Function Tool after core contracts stabilize.
List guardrails for executeQuery.
Constraints:
No MCP implementation change.
Do not encourage arbitrary generated query execution.
Acceptance Criteria:
Document clearly states MCP is a thin adapter, not the source of Graph Memory truth.
Lists future adapter endpoints and safety requirements.
Suggested paths:
docs/geaflow-ai-graph-memory-mcp-adapter.md
GM-AI-P1-043: Implement ModelProviderRegistry
Priority: P0
Difficulty: Intermediate
Context: ChatService and EmbeddingService exist, but model usage is not separated by task such as chat, extract, text2gql, embedding, and rerank.
Scope:
Add registry for task-scoped providers.
Support capability flags: chat, embedding, extraction, text2gql, rerank.
Add fake providers for CI.
Constraints:
Do not remove existing services.
Do not log secrets.
Missing provider must produce typed error with task name.
1. Working Position
Phase 1 should turn the current geaflow-ai prototype into a reproducible Graph Memory reference implementation. The goal is not to copy HugeGraph-AI component names, Gremlin, Faiss, or any specific Python stack. The goal is to provide a user-visible loop:
The current code already has valuable anchors:
TextFileReader,ModelUtils.splitLongText,GraphEntity,MemoryGraph,GraphMemoryServer,EmbeddingIndexStore,KeywordVector,EmbeddingVector,ChatService, REST/CLI entry points, and a separategeaflow-mcpquery tool surface. The missing work is contract, lifecycle, verification, safety, and composable retrieval behavior.2. Project Architecture
flowchart TB Client["CLI / HTTP Client"] --> API["Solon REST<br/>GeaFlowMemoryServer :8080"] API --> Cache["ServerMemoryCache<br/>graph / server / session HashMap"] API --> Core["GraphMemoryServer"] subgraph Write["写入路径"] API --> Mutable["MemoryMutableGraph"] Mutable --> MemGraph["MemoryGraph<br/>进程内 EntityGroup"] Mutable --> Consolidate["ConsolidateServer"] Consolidate --> KeywordRel["KeywordRelationFunction<br/>全图扫描式关系发现"] Consolidate --> EmptyEmb["EmbeddingRelationFunction<br/>空实现"] end subgraph Read["查询路径"] Core --> Session["SessionManagement<br/>会话子图 HashMap"] Core --> KeywordOp["SessionOperator<br/>关键词检索 + 邻域扩展"] Core --> EmbOp["EmbeddingOperator<br/>全量候选线性余弦 TopN"] KeywordOp --> Lucene["临时 Lucene GraphSearchStore<br/>主干按查询重建"] EmbOp --> EmbFile["EmbeddingIndexStore<br/>JSONL 追加文件 + 内存 Map"] Core --> Verb["SubgraphSemanticPromptFunction<br/>子图文本化"] end MemGraph --> KeywordOp MemGraph --> EmbOp Session --> Verb CASTS["CASTS Python Plugin<br/>策略缓存 / Gremlin 状态机 / 仿真"] -. "主干无统一服务契约" .-> Core GeaFlow["Apache GeaFlow 分布式动态图运行时"] -. "GraphComputeEngine 为空;当前未接入" .-> MemGraphDesign rule: every issue below must either freeze a contract, add a deterministic fixture, or implement a small replaceable component. Avoid PRs that mix extraction, storage, retrieval, answer generation, and API changes in one branch.
3. Labels and Difficulty
Suggested labels:
area:ai-memorytype:feature,type:test,type:contract,type:docspriority:P0,priority:P1,priority:P2difficulty:starter,difficulty:intermediate,difficulty:advancedphase:graph-memory-p1good first issueonly when the issue has stable acceptance criteria and does not require architecture decisions.Definition of Ready:
4. Issue Body Template
5. Atomic Issue List
Track A. Document Ingestion and Chunk Lifecycle
GM-AI-P1-001: Define
DocumentSourceandDocumentRecordcontractsPriority: P0
Difficulty: Starter
Suggested labels:
area:ai-memory,type:contract,difficulty:starterContext:
TextFileReadercurrently reads non-empty lines into strings. Graph Memory Phase 1 needs a stable document boundary before chunking, extraction, indexing, and replay can be deterministic.Scope:
DocumentSource,DocumentRecord, andSourceRef.source_id,uri,media_type,charset,content_hash,created_at,ingested_at, andmetadata.Constraints:
Acceptance Criteria:
content_hash.TextFileReadertests remain compatible.Suggested paths:
geaflow-ai/src/main/java/org/apache/geaflow/ai/graph/iogeaflow-ai/src/test/java/org/apache/geaflow/aiGM-AI-P1-002: Implement deterministic
ChunkerSPIPriority: P0
Difficulty: Intermediate
Context:
ModelUtils.splitLongTextcan split long strings, but it does not create stable chunk IDs, offsets, source references, or replay semantics. Chunk identity is required for chunk vector retrieval and citation-aware answers.Scope:
Chunkerinterface and a default text chunker.ChunkRecordwithchunk_id,source_ref,ordinal,start_offset,end_offset,text_hash,policy_version.Constraints:
Acceptance Criteria:
policy_versionand expected chunk IDs.Suggested paths:
geaflow-ai/src/main/java/org/apache/geaflow/ai/chunkgeaflow-ai/src/test/resources/chunkGM-AI-P1-003: Add document replay and deduplication fixtures
Priority: P1
Difficulty: Starter
Context: Graph Memory needs replayable ingestion. If the same document is imported twice, downstream graph facts and indexes should not duplicate silently.
Scope:
source_id + content_hash.Constraints:
Acceptance Criteria:
Suggested paths:
geaflow-ai/src/test/resources/document-replaydocs/graphmemory-design-doc.mdor a newdocs/geaflow-ai-graph-memory-contracts.mdTrack B. Schema-First Extraction and KBQA Triple Strategy
GM-AI-P1-004: Define
ExtractionSchemafor property graph and KBQA triplesPriority: P0
Difficulty: Intermediate
Context: HugeGraph-AI-style import uses schema/prompt-driven extraction. geaflow-ai currently supports pre-structured graph import, but lacks a workflow that converts text paragraphs into typed graph facts or traditional KBQA triples.
Scope:
ExtractionSchemacontract for vertex types, edge types, properties, aliases, required fields, and allowed relation predicates.subject,predicate,object,source_span,confidence.Constraints:
Acceptance Criteria:
Suggested paths:
geaflow-ai/src/main/java/org/apache/geaflow/ai/extract/schemageaflow-ai/src/test/resources/extraction/schemaGM-AI-P1-005: Add
Extraction SPIwith deterministic fake extractorPriority: P0
Difficulty: Intermediate
Context: Phase 1 needs a replaceable extraction layer. Contributors should be able to test the workflow without online LLM credentials.
Scope:
Extractorinterface.ExtractionRequest,ExtractionResult,ExtractedVertex,ExtractedEdge,ExtractedTriple.Constraints:
MemoryGraph.Acceptance Criteria:
Suggested paths:
geaflow-ai/src/main/java/org/apache/geaflow/ai/extractgeaflow-ai/src/test/resources/extraction/resultsGM-AI-P1-006: Implement schema-first property graph extraction prompt builder
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:
ExtractionPromptBuilder.Constraints:
Acceptance Criteria:
Suggested paths:
geaflow-ai/src/main/java/org/apache/geaflow/ai/extract/promptGM-AI-P1-007: Preserve pre-structured graph import as a bypass path
Priority: P1
Difficulty: Starter
Context: geaflow-ai already supports CSV/JSON-like pre-structured graph loading. Phase 1 should not force every user through LLM extraction.
Scope:
Constraints:
Acceptance Criteria:
Suggested paths:
geaflow-ai/src/main/java/org/apache/geaflow/ai/graph/iogeaflow-ai/src/test/resources/importTrack C. Validation, Entity Resolution, and Quarantine
GM-AI-P1-008: Implement
SchemaValidatorfor extracted graph factsPriority: P0
Difficulty: Intermediate
Context:
GraphEntitycan be written today, but extracted facts need schema validation before entering graph storage or indexes.Scope:
Constraints:
Acceptance Criteria:
Suggested paths:
geaflow-ai/src/main/java/org/apache/geaflow/ai/validateGM-AI-P1-009: Add
EntityResolverfor aliases and canonical IDsPriority: P0
Difficulty: Intermediate
Context: Extracted entities can mention the same real-world object under different names. Phase 1 needs deterministic canonicalization before graph writes.
Scope:
canonical_id,alias_used,confidence, andresolution_reason.Constraints:
Acceptance Criteria:
Suggested paths:
geaflow-ai/src/main/java/org/apache/geaflow/ai/resolveGM-AI-P1-010: Define provenance model for facts, chunks, and evidence
Priority: P0
Difficulty: Starter
Context: Citation-aware answers and deletion propagation require source lineage. Existing subgraph verbalization does not provide claim-level provenance.
Scope:
ProvenanceRefandSourceSpancontracts.Constraints:
Acceptance Criteria:
Suggested paths:
geaflow-ai/src/main/java/org/apache/geaflow/ai/provenanceGM-AI-P1-011: Add idempotency key generation for extracted facts
Priority: P0
Difficulty: Starter
Context: Replaying document ingestion must not duplicate vertices, edges, triples, chunks, or evidence records.
Scope:
Constraints:
Acceptance Criteria:
Suggested paths:
geaflow-ai/src/main/java/org/apache/geaflow/ai/common/idGM-AI-P1-012: Add quarantine and dead-letter queue contracts
Priority: P1
Difficulty: Intermediate
Context: Invalid or low-confidence extraction should not be silently discarded or written as facts. Phase 1 needs quarantine visibility.
Scope:
QuarantineRecordandDeadLetterSinkinterfaces.Constraints:
Acceptance Criteria:
Suggested paths:
geaflow-ai/src/main/java/org/apache/geaflow/ai/quarantineTrack D. Graph Backend and Persistence
GM-AI-P1-013: Define
GraphBackendSPIPriority: P0
Difficulty: Advanced
Context: Current main path uses in-process
MemoryGraph;GraphComputeEngineis an empty interface. Phase 1 needs a backend boundary so local persistence and a GeaFlow vertical slice can share contracts.Scope:
GraphBackendinterface for upsert vertex, upsert edge, delete, scan, get schema, and transaction boundary.Constraints:
MemoryGrapheverywhere in this issue.Acceptance Criteria:
GraphAccessorintegration path can be adapted later without breaking tests.Suggested paths:
geaflow-ai/src/main/java/org/apache/geaflow/ai/backendGM-AI-P1-014: Implement local persistent backend prototype
Priority: P1
Difficulty: Intermediate
Context: HugeGraph Server provides persistence in the reference capability. geaflow-ai needs at least a restartable local backend for Phase 1 reference implementation.
Scope:
Constraints:
Acceptance Criteria:
Suggested paths:
geaflow-ai/src/main/java/org/apache/geaflow/ai/backend/localGM-AI-P1-015: Add minimal GeaFlow backend vertical slice design doc
Priority: P1
Difficulty: Starter
Context: GeaFlow is a streaming graph engine, but geaflow-ai currently cannot treat the main engine as an implemented Graph Memory backend. A vertical slice must be scoped before coding.
Scope:
GeaFlowBackendslice.Constraints:
Acceptance Criteria:
Suggested paths:
docs/geaflow-ai-graph-memory-geaflow-backend-slice.mdGM-AI-P1-016: Add graph backend conformance tests
Priority: P0
Difficulty: Intermediate
Context: Multiple backends must behave consistently for Graph Memory retrieval, deletion, and replay.
Scope:
Constraints:
Acceptance Criteria:
Suggested paths:
geaflow-ai/src/test/java/org/apache/geaflow/ai/backendTrack E. Vector, Entity, and Keyword Indexing
GM-AI-P1-017: Define
VectorStoreSPI with model metadataPriority: P0
Difficulty: Intermediate
Context:
EmbeddingIndexStorestores embeddings forGraphEntityin JSONL and memory map. Phase 1 needs a generic vector store contract for both chunks and graph entities.Scope:
VectorStoreinterface.model_name,dimension,distance,index_version,created_at,format_version.Constraints:
EmbeddingIndexStorebehavior.Acceptance Criteria:
Suggested paths:
geaflow-ai/src/main/java/org/apache/geaflow/ai/index/vectorstoreGM-AI-P1-018: Implement
ChunkVectorIndexPriority: P0
Difficulty: Intermediate
Context: HugeGraph-AI-style RAG retrieves document chunks. geaflow-ai currently indexes
GraphEntity, not document chunks.Scope:
VectorStore.chunk_id, source span, embedding, model metadata, and text hash.Constraints:
Acceptance Criteria:
source_ref.Suggested paths:
geaflow-ai/src/main/java/org/apache/geaflow/ai/index/chunkGM-AI-P1-019: Add
EntityVectorIndexwrapper around graph entity embeddingsPriority: P0
Difficulty: Intermediate
Context: Graph entity embedding exists, but Phase 1 needs explicit entity-vector semantics for fuzzy entity anchoring.
Scope:
EmbeddingIndexStorebehavior behindEntityVectorIndex.EmbeddingOperator.Constraints:
Acceptance Criteria:
Suggested paths:
geaflow-ai/src/main/java/org/apache/geaflow/ai/index/entityGM-AI-P1-020: Add minimal ANN adapter interface
Priority: P1
Difficulty: Intermediate
Context: Current vector search is linear TopN. Phase 1 can ship with linear search, but the contract should allow an ANN implementation later.
Scope:
NearestNeighborIndexinterface.Constraints:
Acceptance Criteria:
Suggested paths:
geaflow-ai/src/main/java/org/apache/geaflow/ai/index/annGM-AI-P1-021: Harden keyword index serialization golden tests
Priority: P0
Difficulty: Starter
Context: Keyword retrieval exists through Lucene/keyword vectors, but the main branch behavior has been described as rebuilding during query and vulnerable to noisy common tokens.
Scope:
Constraints:
Acceptance Criteria:
Suggested paths:
geaflow-ai/src/test/java/org/apache/geaflow/ai/indexgeaflow-ai/src/test/resources/index/keywordGM-AI-P1-022: Add searchable watermark for graph, keyword, and vector indexes
Priority: P1
Difficulty: Intermediate
Context: Graph facts and indexes can diverge. Retrieval must know whether graph, keyword, chunk vector, and entity vector projections are searchable for a given import run.
Scope:
SearchableWatermark.Constraints:
Acceptance Criteria:
Suggested paths:
geaflow-ai/src/main/java/org/apache/geaflow/ai/workflowTrack F. Retrieval Modes, Router, Analyzer, and Anchoring
GM-AI-P1-023: Define
RetrievalModecontractPriority: P0
Difficulty: Starter
Context:
GraphMemoryServercurrently iterates over configured index stores. There is no explicit Basic, Vector, Graph, or Hybrid mode contract.Scope:
BASIC,VECTOR,GRAPH,HYBRID.Constraints:
Acceptance Criteria:
Suggested paths:
geaflow-ai/src/main/java/org/apache/geaflow/ai/retrievalGM-AI-P1-024: Implement deterministic
RuleRouterPriority: P0
Difficulty: Intermediate
Context: Phase 1 needs reproducible routing before any learned router. The router should select retrieval mode based on request flags, query shape, and available indexes.
Scope:
RuleRouter.Constraints:
Acceptance Criteria:
Suggested paths:
geaflow-ai/src/main/java/org/apache/geaflow/ai/retrieval/routerGM-AI-P1-025: Define
QueryAnalyzerSPIPriority: P0
Difficulty: Intermediate
Context: geaflow-ai can accept
KeywordVectorandEmbeddingVector, but it lacks a task-specific rewrite/NER pipeline.Scope:
QueryAnalyzerinterface.AnalyzedQuerywith original text, normalized text, keywords, candidate entities, language, and analyzer version.Constraints:
Acceptance Criteria:
Suggested paths:
geaflow-ai/src/main/java/org/apache/geaflow/ai/queryGM-AI-P1-026: Add optional LLM analyzer adapter contract
Priority: P2
Difficulty: Intermediate
Context: Later Graph Memory may use LLM NER/rewrite, but Phase 1 should isolate this behind an adapter and keep deterministic CI.
Scope:
Constraints:
Acceptance Criteria:
Suggested paths:
geaflow-ai/src/main/java/org/apache/geaflow/ai/query/modelGM-AI-P1-027: Implement
EntityAnchorServiceexact-to-fuzzy state machinePriority: P0
Difficulty: Intermediate
Context: Keyword hits and embedding candidates exist separately. Phase 1 needs an explicit exact match to fuzzy match state machine for graph anchoring.
Scope:
EntityAnchorService.Constraints:
Acceptance Criteria:
Suggested paths:
geaflow-ai/src/main/java/org/apache/geaflow/ai/retrieval/anchorGM-AI-P1-028: Add anchor negative corpus
Priority: P1
Difficulty: Starter
Context: Fuzzy anchoring can produce confident wrong graph queries. New contributors can help by building a negative test corpus.
Scope:
Constraints:
Acceptance Criteria:
Suggested paths:
geaflow-ai/src/test/resources/retrieval/anchor-negativeTrack G. Text2GQL, Query Safety, and Fallback
GM-AI-P1-029: Define
Text2GQLSPI and Query IRPriority: P0
Difficulty: Advanced
Context:
geaflow-mcpcan execute caller-provided GQL, but Graph Memory needs natural language to constrained GQL. GeaFlow should use GQL/Query IR, not copy a Gremlin-specific design.Scope:
Text2GqlServiceinterface.GraphQueryIRfor read-only graph query intents.Constraints:
Acceptance Criteria:
Suggested paths:
geaflow-ai/src/main/java/org/apache/geaflow/ai/text2gqlGM-AI-P1-030: Add schema and example-pair index for Text2GQL
Priority: P1
Difficulty: Intermediate
Context: Text2GQL needs schema and examples. This issue builds retrieval of examples, not generation.
Scope:
Constraints:
Acceptance Criteria:
Suggested paths:
geaflow-ai/src/main/java/org/apache/geaflow/ai/text2gql/examplesGM-AI-P1-031: Implement read-only AST/IR guard
Priority: P0
Difficulty: Advanced
Context:
GeaFlowMcpServerTools.executeQueryaccepts arbitrary query text. Graph Memory generated queries must be guarded before execution.Scope:
GraphQueryIRand/or parsed GQL.Constraints:
Acceptance Criteria:
Suggested paths:
geaflow-ai/src/main/java/org/apache/geaflow/ai/securitygeaflow-mcp/src/main/java/org/apache/geaflow/mcp/server/utilGM-AI-P1-032: Add traversal budget contract
Priority: P0
Difficulty: Intermediate
Context: Text2GQL and fallback traversal can explode on high-degree graphs. Phase 1 needs hop, result, time, and memory budgets.
Scope:
TraversalBudget.Constraints:
Acceptance Criteria:
Suggested paths:
geaflow-ai/src/main/java/org/apache/geaflow/ai/retrieval/traversalGM-AI-P1-033: Implement bounded traversal fallback
Priority: P0
Difficulty: Intermediate
Context: Current Graph Memory can expand a one-hop subgraph, but it lacks failure-triggered BFS fallback with explicit reasons.
Scope:
BoundedTraversalFallback.TraversalBudget.Constraints:
Acceptance Criteria:
Suggested paths:
geaflow-ai/src/main/java/org/apache/geaflow/ai/retrieval/traversalTrack H. Chunk Retrieval, Fusion, and Answer Synthesis
GM-AI-P1-034: Implement
ChunkRetrieverPriority: P0
Difficulty: Intermediate
Context: Pure vector RAG requires query vector to chunk vector retrieval. geaflow-ai currently has entity vector search, not chunk retrieval.
Scope:
ChunkRetriever.Constraints:
Acceptance Criteria:
Suggested paths:
geaflow-ai/src/main/java/org/apache/geaflow/ai/retrieval/chunkGM-AI-P1-035: Define normalized
EvidencecontractPriority: P0
Difficulty: Starter
Context: Graph/vector/operator results currently update session subgraphs, but there is no unified evidence object for fusion, rerank, answer citation, or abstention.
Scope:
Evidencecontract.evidence_id,kind,source_ref,source_span,raw_score,normalized_score,retrieval_path,lineage,tenant_id.Constraints:
Acceptance Criteria:
Suggested paths:
geaflow-ai/src/main/java/org/apache/geaflow/ai/evidenceGM-AI-P1-036: Implement RRF and weighted fusion
Priority: P0
Difficulty: Intermediate
Context: Hybrid retrieval needs graph/vector merge with score normalization and dedupe. Current operators mutate session state sequentially without a unified fusion contract.
Scope:
Constraints:
Acceptance Criteria:
Suggested paths:
geaflow-ai/src/main/java/org/apache/geaflow/ai/evidence/fusionGM-AI-P1-037: Add optional reranker SPI
Priority: P1
Difficulty: Intermediate
Context: HugeGraph-AI-style architecture may include rerankers, but Phase 1 should not depend on a remote reranker.
Scope:
Rerankerinterface.Constraints:
Acceptance Criteria:
Suggested paths:
geaflow-ai/src/main/java/org/apache/geaflow/ai/evidence/rerankGM-AI-P1-038: Implement
AnswerSynthesizercontractPriority: P0
Difficulty: Intermediate
Context: geaflow-ai can verbalize a subgraph as context and has
ChatService, but it lacks citation-aware answer workflow.Scope:
AnswerSynthesizer.Constraints:
Acceptance Criteria:
Suggested paths:
geaflow-ai/src/main/java/org/apache/geaflow/ai/answerGM-AI-P1-039: Add claim-to-evidence citation verifier
Priority: P1
Difficulty: Starter
Context: Citation-aware answers are only useful if every claim can be traced to evidence.
Scope:
Constraints:
Acceptance Criteria:
Suggested paths:
geaflow-ai/src/main/java/org/apache/geaflow/ai/answerTrack I. API, Function Tool, MCP Adapter, and Model Providers
GM-AI-P1-040: Define REST v1 Graph Memory contracts
Priority: P0
Difficulty: Intermediate
Context: geaflow-ai has REST/CLI surfaces, but Phase 1 needs stable contracts shared by import, retrieval, answer, and trace.
Scope:
Constraints:
Acceptance Criteria:
Suggested paths:
geaflow-ai/src/main/java/org/apache/geaflow/ai/servicedocs/geaflow-ai-graph-memory-rest-v1.mdGM-AI-P1-041: Add Function Tool facade contract
Priority: P1
Difficulty: Starter
Context: Graph Memory should expose a function-tool-like facade for RAG/agent callers without coupling those callers to internal classes.
Scope:
Constraints:
Acceptance Criteria:
Suggested paths:
geaflow-ai/src/main/java/org/apache/geaflow/ai/toolGM-AI-P1-042: Document MCP thin adapter boundary
Priority: P1
Difficulty: Starter
Context:
geaflow-mcpis currently a separate graph query tool surface. It can execute caller-provided GQL, but should not become the core Graph Memory workflow.Scope:
executeQuery.Constraints:
Acceptance Criteria:
Suggested paths:
docs/geaflow-ai-graph-memory-mcp-adapter.mdGM-AI-P1-043: Implement
ModelProviderRegistryPriority: P0
Difficulty: Intermediate
Context:
ChatServiceandEmbeddingServiceexist, but model usage is not separated by task such as chat, extract, text2gql, embedding, and rerank.Scope:
Constraints:
Acceptance Criteria:
Suggested paths:
geaflow-ai/src/main/java/org/apache/geaflow/ai/common/modelGM-AI-P1-044: Add model timeout, circuit breaker, and cost metadata contract
Priority: P1
Difficulty: Intermediate
Context: Remote model calls affect cost, latency, and reliability. Phase 1 needs observability before production use.
Scope:
Constraints:
Acceptance Criteria:
Suggested paths:
geaflow-ai/src/main/java/org/apache/geaflow/ai/common/modelTrack J. Workflow, Trace, Metrics, and Exclusions
GM-AI-P1-045: Define Workflow SPI and
RunContextPriority: P0
Difficulty: Advanced
Context:
GraphMemoryServerdirectly loops over operators. Phase 1 needs run state, node trace, retry, cancellation, and metrics boundaries.Scope:
Workflow,WorkflowNode,RunContext,NodeResult.Constraints:
Acceptance Criteria:
Suggested paths:
geaflow-ai/src/main/java/org/apache/geaflow/ai/workflowGM-AI-P1-046: Add retrieval trace contract
Priority: P0
Difficulty: Starter
Context: Router, analyzer, anchoring, Text2GQL, fallback, fusion, rerank, and answer synthesis must be inspectable.
Scope:
RetrievalTrace.Constraints:
Acceptance Criteria:
Suggested paths:
geaflow-ai/src/main/java/org/apache/geaflow/ai/traceGM-AI-P1-047: Add Graph Memory metric names and low-cardinality labels
Priority: P1
Difficulty: Starter
Context: Phase 1 needs metrics for ingestion, projection, retrieval, fallback, model calls, and answer behavior.
Scope:
Constraints:
Acceptance Criteria:
Suggested paths:
docs/geaflow-ai-graph-memory-metrics.mdgeaflow-ai/src/main/java/org/apache/geaflow/ai/metricsGM-AI-P1-048: Add Phase 1 exclusion guardrail tests
Priority: P0
Difficulty: Starter
Context: The capability matrix includes training and graph ML, but Phase 1 explicitly excludes pre-training, SFT, PPO, DPO, and large GNN stacks.
Scope:
Constraints:
Acceptance Criteria:
Suggested paths:
docs/geaflow-ai-graph-memory-phase1-scope.mdgeaflow-ai/src/test/java/org/apache/geaflow/aiGM-AI-P1-049: Add contributor guide for Graph Memory atomic issues
Priority: P1
Difficulty: Starter
Context: These issues are intended for new contributors. They need local commands, fixture guidance, and boundaries.
Scope:
Constraints:
Acceptance Criteria:
Suggested paths:
docs/geaflow-ai-graph-memory-contributor-guide.md