Documentation ¶
Index ¶
Constants ¶
View Source
const ( BoltDB = "memoryinternal" BucketName = "memories" )
View Source
const CacheSize = 30
CacheSize is the size of the cache for saving recent documents
Variables ¶
Functions ¶
This section is empty.
Types ¶
type CallOptions ¶
type CallOptions struct {
// contains filtered or unexported fields
}
func WithCacheSize ¶
func WithCacheSize(size int) CallOptions
func WithDataSource ¶
func WithDataSource(ds datasource.DataSourcer) CallOptions
func WithEmbedder ¶
func WithEmbedder(e embeddings.Embedder) CallOptions
func WithVectorStore ¶
func WithVectorStore(vs vectorstore.VectorStorer) CallOptions
type DTO ¶
type DTO struct { VS vectorstore.Converter `json:"vs"` VSType string `json:"vsType"` Emb embeddings.Converter `json:"emb"` EmbType string `json:"embType"` DS datasource.Converter `json:"ds"` DSType string `json:"dsType"` }
func (*DTO) MarshallJSON ¶
func (*DTO) UnmarshalJSON ¶
type Memory ¶
type Memory struct {
// contains filtered or unexported fields
}
Memory is a long-term memory for a chatbot
func New ¶
func New(name string, opts ...CallOptions) *Memory
New creates or loads a new Memory instance from the given options
func (*Memory) NewDocument ¶
NewDocument creates a new document we should be able to accept CreatedAt and LastReadAt as parameters especially if someone already has many conversations that they want to load into this memory
func (*Memory) RetrieveSimilarDocumentsByText ¶
RetrieveSimilarDocumentsByText retrieves similar documents from the Memory TODO Update LastReadAt for the document when it is retrieved
Click to show internal directories.
Click to hide internal directories.