Implement CassandraChatMemory

- provides a flexible schema, can be combined with a vector store, and supports time-to-live rows.
 - fix initialize-schema docs and so that it actually works.
 - move CommonVectorStoreProperties to .vectorstore. package
 - add CassandraAutoConfiguration to the AutoConfiguration.imports
This commit is contained in:
mck
2024-06-11 17:13:12 +02:00
committed by Christian Tzolov
parent cf785e03c2
commit 4aacab020b
35 changed files with 1089 additions and 68 deletions

View File

@@ -369,7 +369,13 @@ The `FILTER_EXPRESSION` parameter allows you to dynamically filter the search re
The interface `ChatMemory` represents a storage for chat conversation history. It provides methods to add messages to a
* conversation, retrieve messages from a conversation, and clear the conversation history.
There is one implementation `InMemoryChatMemory` that provides in-memory storage for chat conversation history.
There are two implementations `InMemoryChatMemory` and `CassandraChatMemory` that provides storage for chat conversation history, in-memory and persisted with time-to-live correspondingly.
To create a CassandraChatMemory with time-to-live
[source,java]
----
CassandraChatMemory.create(CassandraChatMemoryConfig.builder().withTimeToLive(Duration.ofDays(1)).build());
----
Two advisor implementations use the `ChatMemory` interface to advice the prompt with conversation history which differ in the details of how the memory is added to the prompt

View File

@@ -20,14 +20,11 @@ This Spring AI Vector Store is designed to work for both brand-new RAG applicati
The store can also be used for non-RAG use-cases in an existing database, e.g. semantic searches, geo-proximity searches, etc.
The vector store implementation can initialize the requisite schema for you, but you must opt-in by specifying the `initializeSchema` boolean in the appropriate constructor or by setting `...initialize-schema=true` in the `application.properties` file.
NOTE: this is a breaking change! In earlier versions of Spring AI, this schema initialization happened by default.
The store will automatically create, or enhance, the schema as needed according to its configuration. If you don't want the schema modifications, configure the store with `disallowSchemaChanges`.
When using spring-boot-autoconfigure `disallowSchemaChanges` defaults to true, per Spring Boot standards, and you must opt-in to schema creation/modifications by specifying the `initializeSchema` boolean in the appropriate constructor or by setting `...initialize-schema=true` in the `application.properties` file.
== What is JVector ?
link:https://github.com/jbellis/jvector[JVector] is a pure Java embedded vector search engine.