+ : (selectedNode as RawCommunityNode).properties.community_id
+ ?
+
+ {(selectedNode as RawCommunityNode).properties.name}
+
+
{t('userMemory.summary')}
+
+ {(selectedNode as RawCommunityNode).properties.summary}
+
+
+ {t('userMemory.member_count')}
+ {(selectedNode as RawCommunityNode).properties.member_count}{t('userMemory.member_count_desc')}
+
+
+
+
{t('userMemory.core_entities')}
+
+ {(selectedNode as RawCommunityNode).properties.core_entities.map((entity, index) => - {entity}
)}
+
+
+ : <>
+ {(selectedNode as Node).name && (
+
{t('userMemory.memoryContent')}
{['Chunk', 'Dialogue', 'MemorySummary'].includes(selectedNode.label) && 'content' in selectedNode.properties
? selectedNode.properties.content
: selectedNode.label === 'ExtractedEntity' && 'description' in selectedNode.properties
- ? selectedNode.properties.description
- : selectedNode.label === 'Statement' && 'statement' in selectedNode.properties
- ? selectedNode.properties.statement
- : ''
- }
-
- >
-
-
{t('userMemory.created_at')}
-
- {dayjs(selectedNode?.properties.created_at).format('YYYY-MM-DD HH:mm:ss')}
+ ? selectedNode.properties.description
+ : selectedNode.label === 'Statement' && 'statement' in selectedNode.properties
+ ? selectedNode.properties.statement
+ : ''}
- {selectedNode?.properties.associative_memory > 0 &&
-
{t('userMemory.associative_memory')}
+
+
{t('userMemory.created_at')}
- {selectedNode?.properties.associative_memory} {t('userMemory.unix')}{t('userMemory.associative_memory')}
+ {dayjs((selectedNode as Node).properties.created_at).format('YYYY-MM-DD HH:mm:ss')}
-
}
- {selectedNode.label === 'Statement' && <>
- {(['emotion_keywords', 'emotion_type', 'emotion_subject', 'importance_score'] as const).map(key => {
- const statementProps = selectedNode.properties as StatementNodeProperties;
- if ((key === 'emotion_keywords' && statementProps[key]?.length > 0) || typeof statementProps[key] === 'string') {
- console.log('statementProps[key]', statementProps[key])
- return (
-
- {t(`userMemory.Statement_${key}`)}
-
- {key === 'emotion_keywords'
- ?
{statementProps.emotion_keywords.map((vo, index) => {vo})}
- : statementProps[key]
- }
+ {(selectedNode as Node).properties.associative_memory > 0 && (
+
+
{t('userMemory.associative_memory')}
+
+ {(selectedNode as Node).properties.associative_memory}
+ {' '}{t('userMemory.unix')}{t('userMemory.associative_memory')}
+
+
+ )}
+
+ {selectedNode.label === 'Statement' && (
+ (['emotion_keywords', 'emotion_type', 'emotion_subject', 'importance_score'] as const).map(key => {
+ const p = selectedNode.properties as StatementNodeProperties
+ if ((key === 'emotion_keywords' && p[key]?.length > 0) || typeof p[key] === 'string') {
+ return (
+
+ {t(`userMemory.Statement_${key}`)}
+
+ {key === 'emotion_keywords'
+ ? {p.emotion_keywords.map((v, i) => {v})}
+ : p[key]}
+
-
- )
- }
- return null
- })}
- >}
- {selectedNode.label === 'ExtractedEntity' && <>
- {(['name', 'entity_type', 'aliases', 'connect_strngth', 'importance_score'] as const).map(key => {
- const entityProps = selectedNode.properties as ExtractedEntityNodeProperties;
- if (entityProps[key]) {
- return (
-
- {t(`userMemory.ExtractedEntity_${key}`)}
-
- {Array.isArray(entityProps[key]) && entityProps[key].length > 0
- ? entityProps[key].map((vo, index) =>
- {vo}
)
- : entityProps[key]
- }
+ )
+ }
+ return null
+ })
+ )}
+
+ {selectedNode.label === 'ExtractedEntity' && (
+ (['name', 'entity_type', 'aliases', 'connect_strngth', 'importance_score'] as const).map(key => {
+ const p = selectedNode.properties as ExtractedEntityNodeProperties
+ if (p[key]) {
+ return (
+
+ {t(`userMemory.ExtractedEntity_${key}`)}
+
+ {Array.isArray(p[key]) && p[key].length > 0
+ ? p[key].map((v, i) =>
- {v}
)
+ : p[key]}
+
-
- )
- }
- return null
- })}
- >}
+ )
+ }
+ return null
+ })
+ )}
+
-
- >
+ >
}
diff --git a/web/src/views/UserMemoryDetail/types.ts b/web/src/views/UserMemoryDetail/types.ts
index 8333cb2c..72e896ad 100644
--- a/web/src/views/UserMemoryDetail/types.ts
+++ b/web/src/views/UserMemoryDetail/types.ts
@@ -1,8 +1,8 @@
/*
* @Author: ZhaoYing
* @Date: 2026-02-03 17:57:15
- * @Last Modified by: ZhaoYing
- * @Last Modified time: 2026-02-03 17:57:15
+ * @Last Modified by: ZhaoYing
+ * @Last Modified time: 2026-03-13 11:49:52
*/
/**
* User Memory Detail Types
@@ -90,6 +90,7 @@ export interface ExtractedEntityNodeProperties {
connect_strngth: string;
importance_score: number;
associative_memory: number;
+ community_name?: string;
}
/**
* Memory summary node
@@ -246,4 +247,53 @@ export interface ForgetData {
*/
export interface GraphDetailRef {
handleOpen: (vo: Node) => void
-}
\ No newline at end of file
+}
+// Community
+export type CommunityNodeType = 'Community' | 'ExtractedEntity';
+export type CommunityEdgeType = 'BELONGS_TO_COMMUNITY' | 'EXTRACTED_RELATIONSHIP';
+export type CommunityEntityType = "Person" | "Organization" | "ORG" | "Location" | "LOC" | "Event" | "Concept" | "Time" | "Position" | "WorkRole" | "System" | "Policy" | "HistoricalPeriod" | "HistoricalState" | "HistoricalEvent" | "EconomicFactor" | "Condition" | "Numeric" | "Work";
+// 社区节点
+export interface CommunityTypeNode {
+ id: string;
+ label: 'Community';
+ properties: {
+ community_id: string;
+ end_user_id: string;
+ member_count: number;
+ updated_at: string;
+ name: string;
+ summary: string;
+ core_entities: string[];
+ member_entity_ids: string[];
+ };
+}
+// 核心实体
+export interface ExtractedEntityTypeNode {
+ id: string;
+ label: 'ExtractedEntity';
+ properties: {
+ name: string;
+ end_user_id: string;
+ description: string;
+ created_at: string;
+ entity_type: CommunityEntityType;
+ community_name: string;
+ };
+}
+// 社区图谱连线
+export interface CommunityEdge {
+ id: string;
+ target: string;
+ source: string;
+}
+export interface CommunityStatistics {
+ total_nodes: number;
+ total_edges: number;
+ node_types: Record
;
+ edge_types: Record;
+}
+export interface CommunityGraphData {
+ nodes: (CommunityTypeNode | ExtractedEntityTypeNode)[];
+ edges: CommunityEdge[];
+ statistics: CommunityStatistics;
+}