import { BaseEntity } from '../../base/entity/base.js';
import { Column, Entity, Index } from 'typeorm';

/**
 * NetaClaw 长期记忆
 */
@Entity('netaclaw_memory')
export class NetaClawMemoryEntity extends BaseEntity {
  @Index()
  @Column({ comment: 'Agent名称', length: 100 })
  agentName: string;

  @Index()
  @Column({ comment: '用户ID', length: 100 })
  userId: string;

  @Index()
  @Column({ comment: '记忆类型: user/project/feedback/reference', length: 20 })
  type: string;

  @Column({ comment: '记忆标题', length: 255 })
  name: string;

  @Column({ type: 'text', comment: '记忆正文' })
  content: string;

  @Column({ comment: '一行描述', length: 500, default: '' })
  description: string;

  @Column({ type: 'json', comment: '元数据', nullable: true })
  metadata: Record<string, unknown>;
}
