Skip to content

Commit fe58faa

Browse files
authored
.Net: Update vector store readme's (#11801)
### Motivation and Context We have some broken links in the readme's and they are still referring to memory store which is being replaced. ### Description - Updated readme files to not advertise memory store anymore. - Updated readme files to point to learn site docs. ### Contribution Checklist <!-- Before submitting this PR, please make sure: --> - [ ] The code builds clean without any errors or warnings - [ ] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [ ] All unit tests pass, and I have added new tests where possible - [ ] I didn't break anyone 😄
1 parent 490d644 commit fe58faa

File tree

6 files changed

+10
-115
lines changed

6 files changed

+10
-115
lines changed

dotnet/src/Connectors/Connectors.Memory.Chroma/README.md

-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ docker-compose up -d --build
2121

2222
3. Use Semantic Kernel with Chroma, using server local endpoint `http://localhost:8000`:
2323

24-
> See [Example 14](../../../samples/Concepts/Memory/SemanticTextMemory_Building.cs) and [Example 15](../../../samples/Concepts/Memory/TextMemoryPlugin_MultipleMemoryStore.cs) for more memory usage examples with the kernel.
25-
2624
```csharp
2725
const string endpoint = "http://localhost:8000";
2826

dotnet/src/Connectors/Connectors.Memory.Kusto/README.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
# Microsoft.SemanticKernel.Connectors.Kusto
22

3-
This connector uses [Azure Data Explorer (Kusto)](https://learn.microsoft.com/en-us/azure/data-explorer/) to implement Semantic Memory.
3+
This connector uses [Azure Data Explorer (Kusto)](https://learn.microsoft.com/azure/data-explorer/) to implement Semantic Memory.
44

55
## Quick Start
66

7-
1. Create a cluster and database in Azure Data Explorer (Kusto) - see https://learn.microsoft.com/en-us/azure/data-explorer/create-cluster-and-database?tabs=free
7+
1. Create a cluster and database in Azure Data Explorer (Kusto) - see https://learn.microsoft.com/azure/data-explorer/create-cluster-and-database?tabs=free
88

99
2. To use Kusto as a semantic memory store, use the following code:
10-
> See [Example 14](../../../samples/Concepts/Memory/SemanticTextMemory_Building.cs) and [Example 15](../../../samples/Concepts/Memory/TextMemoryPlugin_MultipleMemoryStore.cs) for more memory usage examples with the kernel.
1110

1211
```csharp
1312
using Kusto.Data;
@@ -37,9 +36,9 @@ The function is called `series_cosine_similarity_fl` and is located in the `Func
3736

3837
Kusto is an append-only store. This means that when a fact is updated, the old fact is not deleted.
3938
This isn't a problem for the semantic memory connector, as it always utilizes the most recent fact.
40-
This is made possible by using the [arg_max](https://learn.microsoft.com/en-us/azure/data-explorer/kusto/query/arg-max-aggfunction) aggregation function in conjunction with the [ingestion_time](https://learn.microsoft.com/en-us/azure/data-explorer/kusto/query/ingestiontimefunction) function.
39+
This is made possible by using the [arg_max](https://learn.microsoft.com/azure/data-explorer/kusto/query/arg-max-aggfunction) aggregation function in conjunction with the [ingestion_time](https://learn.microsoft.com/azure/data-explorer/kusto/query/ingestiontimefunction) function.
4140
However, users manually querying the underlying table should be aware of this behavior.
4241

4342
### Authentication
4443

45-
Please note that the authentication used in the example above is not recommended for production use. You can find more details here: https://learn.microsoft.com/en-us/azure/data-explorer/kusto/api/connection-strings/kusto
44+
Please note that the authentication used in the example above is not recommended for production use. You can find more details here: https://learn.microsoft.com/azure/data-explorer/kusto/api/connection-strings/kusto

dotnet/src/Connectors/Connectors.Memory.Milvus/README.md

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ docker-compose up -d
1919
```
2020

2121
3. Use Semantic Kernel with Milvus, connecting to `localhost` with the default (gRPC) port of 1536:
22-
> See [Example 14](../../../samples/Concepts/Memory/SemanticTextMemory_Building.cs) and [Example 15](../../../samples/Concepts/Memory/TextMemoryPlugin_MultipleMemoryStore.cs) for more memory usage examples with the kernel.
2322

2423
```csharp
2524
using MilvusMemoryStore memoryStore = new("localhost");

dotnet/src/Connectors/Connectors.Memory.MongoDB/README.md

+2-38
Original file line numberDiff line numberDiff line change
@@ -6,44 +6,8 @@ This connector uses [MongoDB Atlas Vector Search](https://www.mongodb.com/produc
66

77
1. Create [Atlas cluster](https://www.mongodb.com/docs/atlas/getting-started/)
88

9-
2. Create a [collection](https://www.mongodb.com/docs/atlas/atlas-ui/collections/)
9+
2. Create a Mongo DB Vector Store using instructions on the [Microsoft Learn site](https://learn.microsoft.com/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/mongodb-connector).
1010

11-
3. Create [Vector Search Index](https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-overview/) for the collection. The index has to be defined on a field called `embedding`. For example:
12-
13-
```
14-
{
15-
"type": "vectorSearch",
16-
"fields": [
17-
{
18-
"numDimensions": <number-of-dimensions>,
19-
"path": "embedding",
20-
"similarity": "euclidean | cosine | dotProduct",
21-
"type": "vector"
22-
}
23-
]
24-
}
25-
```
26-
27-
4. Create the MongoDB memory store
28-
> See [Example 14](../../../samples/Concepts/Memory/SemanticTextMemory_Building.cs) and [Example 15](../../../samples/Concepts/Memory/TextMemoryPlugin_MultipleMemoryStore.cs) for more memory usage examples with the kernel.
29-
30-
```csharp
31-
var connectionString = "MONGODB ATLAS CONNECTION STRING"
32-
MongoDBMemoryStore memoryStore = new(connectionString, "MyDatabase");
33-
34-
var embeddingGenerator = new OpenAITextEmbeddingGenerationService("text-embedding-ada-002", apiKey);
35-
36-
SemanticTextMemory textMemory = new(memoryStore, embeddingGenerator);
37-
38-
var memoryPlugin = kernel.ImportPluginFromObject(new TextMemoryPlugin(textMemory));
39-
```
11+
3. Use the [getting started instructions](https://learn.microsoft.com/semantic-kernel/concepts/vector-store-connectors/?pivots=programming-language-csharp#getting-started-with-vector-store-connectors) on the Microsoft Leearn site to learn more about using the vector store.
4012

4113
> Guide to find the connection string: https://www.mongodb.com/docs/manual/reference/connection-string/
42-
43-
## Important Notes
44-
45-
### Vector search indexes
46-
47-
In this version, vector search index management is outside of `MongoDBMemoryStore` scope.
48-
Creation and maintenance of the indexes have to be done by the user. Please note that deleting a collection
49-
(`memoryStore.DeleteCollectionAsync`) will delete the index as well.

dotnet/src/Connectors/Connectors.Memory.Postgres/README.md

+2-54
Original file line numberDiff line numberDiff line change
@@ -37,58 +37,6 @@ sk_demo=# CREATE EXTENSION vector;
3737

3838
See [this sample](../../../samples/Concepts/Memory/VectorStore_VectorSearch_MultiStore_Postgres.cs) for an example of using the vector store.
3939

40-
### Using PostgresMemoryStore
40+
For more information on using Postgres as a vector store, see the [PostgresVectorStore](https://learn.microsoft.com/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/postgres-connector) documentation.
4141

42-
> See [Example 14](../../../samples/Concepts/Memory/SemanticTextMemory_Building.cs) and [Example 15](../../../samples/Concepts/Memory/TextMemoryPlugin_MultipleMemoryStore.cs) for more memory usage examples with the kernel.
43-
44-
```csharp
45-
NpgsqlDataSourceBuilder dataSourceBuilder = new NpgsqlDataSourceBuilder("Host=localhost;Port=5432;Database=sk_demo;User Id=postgres;Password=mysecretpassword");
46-
dataSourceBuilder.UseVector();
47-
NpgsqlDataSource dataSource = dataSourceBuilder.Build();
48-
49-
var memoryWithPostgres = new MemoryBuilder()
50-
.WithPostgresMemoryStore(dataSource, vectorSize: 1536/*, schema: "public" */)
51-
.WithLoggerFactory(loggerFactory)
52-
.WithOpenAITextEmbeddingGeneration("text-embedding-ada-002", apiKey)
53-
.Build();
54-
55-
var memoryPlugin = kernel.ImportPluginFromObject(new TextMemoryPlugin(memoryWithPostgres));
56-
```
57-
58-
### Create Index
59-
60-
> By default, pgvector performs exact nearest neighbor search, which provides perfect recall.
61-
62-
> You can add an index to use approximate nearest neighbor search, which trades some recall for performance. Unlike typical indexes, you will see different results for queries after adding an approximate index.
63-
64-
> Three keys to achieving good recall are:
65-
>
66-
> - Create the index after the table has some data
67-
> - Choose an appropriate number of lists - a good place to start is rows / 1000 for up to 1M rows and sqrt(rows) for over 1M rows
68-
> - When querying, specify an appropriate number of probes (higher is better for recall, lower is better for speed) - a good place to start is sqrt(lists)
69-
70-
Please read [the documentation](https://github.com/pgvector/pgvector#indexing) for more information.
71-
72-
Based on the data rows of your collection table, consider the following statement to create an index.
73-
74-
```sql
75-
DO $$
76-
DECLARE
77-
collection TEXT;
78-
c_count INTEGER;
79-
BEGIN
80-
SELECT 'REPLACE YOUR COLLECTION TABLE NAME' INTO collection;
81-
82-
-- Get count of records in collection
83-
EXECUTE format('SELECT count(*) FROM public.%I;', collection) INTO c_count;
84-
85-
-- Create Index (https://github.com/pgvector/pgvector#indexing)
86-
IF c_count > 10000000 THEN
87-
EXECUTE format('CREATE INDEX %I ON public.%I USING ivfflat (embedding vector_cosine_ops) WITH (lists = %s);',
88-
collection || '_ix', collection, ROUND(sqrt(c_count)));
89-
ELSIF c_count > 10000 THEN
90-
EXECUTE format('CREATE INDEX %I ON public.%I USING ivfflat (embedding vector_cosine_ops) WITH (lists = %s);',
91-
collection || '_ix', collection, c_count / 1000);
92-
END IF;
93-
END $$;
94-
```
42+
Use the [getting started instructions](https://learn.microsoft.com/semantic-kernel/concepts/vector-store-connectors/?pivots=programming-language-csharp#getting-started-with-vector-store-connectors) on the Microsoft Leearn site to learn more about using the vector store.

dotnet/src/Connectors/Connectors.Memory.Redis/README.md

+2-15
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,6 @@ Ways to get RediSearch:
2222
docker run -d --name redis-stack-server -p 6379:6379 redis/redis-stack-server:latest
2323
```
2424

25-
2. To use Redis as a semantic memory store:
26-
> See [Example 14](../../../samples/Concepts/Memory/SemanticTextMemory_Building.cs) and [Example 15](../../../samples/Concepts/Memory/TextMemoryPlugin_MultipleMemoryStore.cs) for more memory usage examples with the kernel.
25+
2. Create a Redis Vector Store using instructions on the [Microsoft Learn site](https://learn.microsoft.com/semantic-kernel/concepts/vector-store-connectors/out-of-the-box-connectors/redis-connector).
2726

28-
```csharp
29-
// ConnectionMultiplexer should be a singleton instance in your application, please consider to dispose of it when your application shuts down.
30-
// See https://stackexchange.github.io/StackExchange.Redis/Basics#basic-usage
31-
ConnectionMultiplexer connectionMultiplexer = await ConnectionMultiplexer.ConnectAsync("localhost:6379");
32-
IDatabase database = connectionMultiplexer.GetDatabase();
33-
RedisMemoryStore memoryStore = new RedisMemoryStore(database, vectorSize: 1536);
34-
35-
var embeddingGenerator = new OpenAITextEmbeddingGenerationService("text-embedding-ada-002", apiKey);
36-
37-
SemanticTextMemory textMemory = new(memoryStore, embeddingGenerator);
38-
39-
var memoryPlugin = kernel.ImportPluginFromObject(new TextMemoryPlugin(textMemory));
40-
```
27+
3. Use the [getting started instructions](https://learn.microsoft.com/semantic-kernel/concepts/vector-store-connectors/?pivots=programming-language-csharp#getting-started-with-vector-store-connectors) on the Microsoft Leearn site to learn more about using the vector store.

0 commit comments

Comments
 (0)