BackfillFacts embeds and stores the supplied (id,text) fact pairs.
(ctx context.Context, items map[string]string)
| 71 | |
| 72 | // BackfillFacts embeds and stores the supplied (id,text) fact pairs. |
| 73 | func (v *VectorIndex) BackfillFacts(ctx context.Context, items map[string]string) error { |
| 74 | if v == nil { |
| 75 | return nil |
| 76 | } |
| 77 | return v.idx.Upsert(ctx, items) |
| 78 | } |
| 79 | |
| 80 | // ScoredFact pairs a fact id with the cosine similarity that surfaced it. |
| 81 | type ScoredFact struct { |