You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+27-7Lines changed: 27 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,9 +11,7 @@ Because `chromem-go` is embeddable it enables you to add retrieval augmented gen
11
11
12
12
It's *not* a library to connect to Chroma and also not a reimplementation of it in Go. It's a database on its own.
13
13
14
-
The focus is not scale or number of features, but simplicity.
15
-
16
-
Performance has not been a priority yet. Without optimizations (except some parallelization with goroutines) querying 5,000 documents takes ~500ms on a mid-range laptop CPU (11th Gen Intel i5-1135G7, like in the first generation Framework Laptop 13).
14
+
The focus is not scale (millions of documents) or number of features, but simplicity and performance for the most common use cases. On a mid-range 2020 Intel laptop CPU you can query 1,000 documents in 0.5 ms and 100,000 documents in 56 ms, both with just 44 memory allocations. See [Benchmarks](#benchmarks) for details.
17
15
18
16
> ⚠️ The project is in beta, under heavy construction, and may introduce breaking changes in releases before `v1.0.0`. All changes are documented in the [`CHANGELOG`](./CHANGELOG.md).
19
17
@@ -23,8 +21,9 @@ Performance has not been a priority yet. Without optimizations (except some para
23
21
2.[Interface](#interface)
24
22
3.[Features](#features)
25
23
4.[Usage](#usage)
26
-
5.[Motivation](#motivation)
27
-
6.[Related projects](#related-projects)
24
+
5.[Benchmarks](#benchmarks)
25
+
6.[Motivation](#motivation)
26
+
7.[Related projects](#related-projects)
28
27
29
28
## Use cases
30
29
@@ -156,8 +155,7 @@ See the Godoc for details: <https://pkg.go.dev/github.com/philippgille/chromem-g
156
155
### Roadmap
157
156
158
157
- Performance:
159
-
-[ ] Add Go benchmark code
160
-
-[ ] Improve code based on CPU and memory profiles
158
+
-[ ] Add SIMD / Assembler to speed up dot product calculation
161
159
- Embedding creators:
162
160
-[ ] Add an `EmbeddingFunc` that downloads and shells out to [llamafile](https://github.com/Mozilla-Ocho/llamafile)
163
161
- Similarity search:
@@ -182,6 +180,28 @@ See the Godoc for a reference: <https://pkg.go.dev/github.com/philippgille/chrom
182
180
183
181
For full, working examples, using the vector database for retrieval augmented generation (RAG) and semantic search and using either OpenAI or locally running the embeddings model and LLM (in Ollama), see the [example code](examples).
184
182
183
+
## Benchmarks
184
+
185
+
```console
186
+
$ go test -benchmem -run=^$ -bench .
187
+
goos: linux
188
+
goarch: amd64
189
+
pkg: github.com/philippgille/chromem-go
190
+
cpu: 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
In December 2023, when I wanted to play around with retrieval augmented generation (RAG) in a Go program, I looked for a vector database that could be embedded in the Go program, just like you would embed SQLite in order to not require any separate DB setup and maintenance. I was surprised when I didn't find any, given the abundance of embedded key-value stores in the Go ecosystem.
0 commit comments