File size: 1,164 Bytes
eb846d0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import {
  Entity,
  PrimaryGeneratedColumn,
  Column,
  CreateDateColumn,
  UpdateDateColumn,
} from 'typeorm';

@Entity({ name: 'vector_embeddings' })
export class VectorEmbedding {
  @PrimaryGeneratedColumn('uuid')
  id: string;

  @Column({ type: 'varchar' })
  content_type: string; // 'market_server', 'tool', 'documentation', etc.

  @Column({ type: 'varchar' })
  content_id: string; // Reference ID to the original content

  @Column('text')
  text_content: string; // The text that was embedded

  @Column('simple-json')
  metadata: Record<string, any>; // Additional metadata about the embedding

  @Column({
    type: 'float',
    array: true,
    nullable: true,
  })
  embedding: number[]; // The vector embedding - will be converted to vector type after table creation

  @Column({ type: 'int' })
  dimensions: number; // Dimensionality of the embedding vector

  @Column({ type: 'varchar' })
  model: string; // Model used to create the embedding

  @CreateDateColumn({ name: 'created_at', type: 'timestamp' })
  createdAt: Date;

  @UpdateDateColumn({ name: 'updated_at', type: 'timestamp' })
  updatedAt: Date;
}

export default VectorEmbedding;