diff --git a/examples/rag-wikipedia-ollama/README.md b/examples/rag-wikipedia-ollama/README.md index 539e90c..60612c8 100644 --- a/examples/rag-wikipedia-ollama/README.md +++ b/examples/rag-wikipedia-ollama/README.md @@ -29,7 +29,7 @@ The output can differ slightly on each run, but it's along the lines of: 2024/03/02 20:02:34 Reading JSON lines... 2024/03/02 20:02:34 Adding documents to chromem-go, including creating their embeddings via Ollama API... 2024/03/02 20:03:11 Querying chromem-go... -2024/03/02 20:03:11 Search took 231.672667ms +2024/03/02 20:03:11 Search (incl query embedding) took 231.672667ms 2024/03/02 20:03:11 Document 1 (similarity: 0.723627): "Malleable Iron Range Company was a company that existed from 1896 to 1985 and primarily produced kitchen ranges made of malleable iron but also produced a variety of other related products. The company's primary trademark was 'Monarch' and was colloquially often referred to as the Monarch Company or just Monarch." 2024/03/02 20:03:11 Document 2 (similarity: 0.550584): "The American Motor Car Company was a short-lived company in the automotive industry founded in 1906 lasting until 1913. It was based in Indianapolis Indiana United States. The American Motor Car Company pioneered the underslung design." 2024/03/02 20:03:11 Asking LLM with augmented question... diff --git a/examples/rag-wikipedia-ollama/main.go b/examples/rag-wikipedia-ollama/main.go index 4d451ae..ce1cc47 100644 --- a/examples/rag-wikipedia-ollama/main.go +++ b/examples/rag-wikipedia-ollama/main.go @@ -104,7 +104,7 @@ func main() { if err != nil { panic(err) } - log.Println("Search took", time.Since(start)) + log.Println("Search (incl query embedding) took", time.Since(start)) // Here you could filter out any documents whose similarity is below a certain threshold. // if docRes[...].Similarity < 0.5 { ... @@ -129,7 +129,7 @@ func main() { 2024/03/02 20:02:34 Reading JSON lines... 2024/03/02 20:02:34 Adding documents to chromem-go, including creating their embeddings via Ollama API... 2024/03/02 20:03:11 Querying chromem-go... - 2024/03/02 20:03:11 Search took 231.672667ms + 2024/03/02 20:03:11 Search (incl query embedding) took 231.672667ms 2024/03/02 20:03:11 Document 1 (similarity: 0.723627): "Malleable Iron Range Company was a company that existed from 1896 to 1985 and primarily produced kitchen ranges made of malleable iron but also produced a variety of other related products. The company's primary trademark was 'Monarch' and was colloquially often referred to as the Monarch Company or just Monarch." 2024/03/02 20:03:11 Document 2 (similarity: 0.550584): "The American Motor Car Company was a short-lived company in the automotive industry founded in 1906 lasting until 1913. It was based in Indianapolis Indiana United States. The American Motor Car Company pioneered the underslung design." 2024/03/02 20:03:11 Asking LLM with augmented question... diff --git a/examples/semantic-search-arxiv-openai/README.md b/examples/semantic-search-arxiv-openai/README.md index 1292fcf..829024f 100644 --- a/examples/semantic-search-arxiv-openai/README.md +++ b/examples/semantic-search-arxiv-openai/README.md @@ -12,8 +12,8 @@ This is not a retrieval augmented generation (RAG) app, because after *retrievin 1. Ensure you have [ripgrep](https://github.com/BurntSushi/ripgrep) installed, or adapt the following commands to use grep 2. Run `rg '"categories":"cs.CL"' ~/Downloads/arxiv-metadata-oai-snapshot.json | rg '"update_date":"2023' > /tmp/arxiv_cs-cl_2023.jsonl` (adapt input file path if necessary) 3. Check the data - 1. `wc -l arxiv_cs-cl_2023.jsonl` should show ~5,000 lines - 2. `du -h arxiv_cs-cl_2023.jsonl` should show ~8.8 MB + 1. `wc -l /tmp/arxiv_cs-cl_2023.jsonl` should show ~5,000 lines + 2. `du -h /tmp/arxiv_cs-cl_2023.jsonl` should show ~8.8 MB 2. Set the OpenAI API key in your env as `OPENAI_API_KEY` 3. Run the example: `go run .` @@ -27,7 +27,7 @@ The output can differ slightly on each run, but it's along the lines of: 2024/03/10 18:23:55 Read and parsed 5006 documents. 2024/03/10 18:23:55 Adding documents to chromem-go, including creating their embeddings via OpenAI API... 2024/03/10 18:28:12 Querying chromem-go... - 2024/03/10 18:28:12 Search took 529.451163ms + 2024/03/10 18:28:12 Search (incl query embedding) took 529.451163ms 2024/03/10 18:28:12 Search results: 1) Similarity 0.488895: URL: https://arxiv.org/abs/2209.15469 diff --git a/examples/semantic-search-arxiv-openai/main.go b/examples/semantic-search-arxiv-openai/main.go index e0d341b..c52c366 100644 --- a/examples/semantic-search-arxiv-openai/main.go +++ b/examples/semantic-search-arxiv-openai/main.go @@ -93,7 +93,7 @@ func main() { if err != nil { panic(err) } - log.Println("Search took", time.Since(start)) + log.Println("Search (incl query embedding) took", time.Since(start)) // Here you could filter out any documents whose similarity is below a certain threshold. // if docRes[...].Similarity < 0.5 { ... @@ -117,7 +117,7 @@ func main() { 2024/03/10 18:23:55 Read and parsed 5006 documents. 2024/03/10 18:23:55 Adding documents to chromem-go, including creating their embeddings via OpenAI API... 2024/03/10 18:28:12 Querying chromem-go... - 2024/03/10 18:28:12 Search took 529.451163ms + 2024/03/10 18:28:12 Search (incl query embedding) took 529.451163ms 2024/03/10 18:28:12 Search results: 1) Similarity 0.488895: URL: https://arxiv.org/abs/2209.15469