MemoryStore 一个简单的内存向量存储实现, 仅用于示例和测试。 不适合生产环境, 但可以帮助用户快速理解接口用法。
| 10 | // MemoryStore 一个简单的内存向量存储实现, 仅用于示例和测试。 |
| 11 | // 不适合生产环境, 但可以帮助用户快速理解接口用法。 |
| 12 | type MemoryStore struct { |
| 13 | mu sync.RWMutex |
| 14 | docs map[string]Document |
| 15 | index map[string][]string // namespace -> []docID |
| 16 | } |
| 17 | |
| 18 | // NewMemoryStore 创建内存向量存储。 |
| 19 | func NewMemoryStore() *MemoryStore { |
nothing calls this directly
no outgoing calls
no test coverage detected