Help us shape the future of Go! Take the 2026 Go Developer Survey

memory

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 6, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Faiss

type Faiss struct {
	// contains filtered or unexported fields
}

Faiss implements VectorStore against a simple REST wrapper.

func NewFaiss

func NewFaiss(endpoint string) *Faiss

NewFaiss returns a new Faiss store.

func (*Faiss) Add

func (f *Faiss) Add(ctx context.Context, id, text string) error

func (*Faiss) Query

func (f *Faiss) Query(ctx context.Context, text string, k int) ([]string, error)

type InMemory

type InMemory struct {
	// contains filtered or unexported fields
}

InMemory is a thread-safe implementation.

func NewInMemory

func NewInMemory() *InMemory

func (*InMemory) AddStep

func (m *InMemory) AddStep(step Step)

func (*InMemory) History

func (m *InMemory) History() []Step

func (*InMemory) SetHistory

func (m *InMemory) SetHistory(hist []Step)

type InMemoryVector

type InMemoryVector struct {
	// contains filtered or unexported fields
}

InMemoryVector is a naive store keeping text docs.

func NewInMemoryVector

func NewInMemoryVector() *InMemoryVector

func (*InMemoryVector) Add

func (v *InMemoryVector) Add(_ context.Context, id, text string) error

func (*InMemoryVector) Query

func (v *InMemoryVector) Query(_ context.Context, text string, k int) ([]string, error)

type Qdrant

type Qdrant struct {
	// contains filtered or unexported fields
}

Qdrant implements VectorStore against the Qdrant REST API.

func NewQdrant

func NewQdrant(endpoint, collection string) *Qdrant

NewQdrant returns a new Qdrant store pointing at the given endpoint and collection.

func (*Qdrant) Add

func (q *Qdrant) Add(ctx context.Context, id, text string) error

func (*Qdrant) Query

func (q *Qdrant) Query(ctx context.Context, text string, k int) ([]string, error)

type Step

type Step struct {
	Output      string
	ToolCalls   []model.ToolCall
	ToolResults map[string]string
}

type Store

type Store interface {
	AddStep(step Step)
	History() []Step
	SetHistory([]Step)
}

type VectorStore

type VectorStore interface {
	Add(ctx context.Context, id, text string) error
	Query(ctx context.Context, text string, k int) ([]string, error)
}

VectorStore defines minimal interface for vector retrieval.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL