Documentation
¶
Overview ¶
Package sqlfts implements pkg/memory.Backend on top of pure-Go SQLite with FTS5 full-text search (github.com/glebarez/sqlite).
Importing this package registers the "sqlite" URI scheme with pkg/memory.RegisterOpener so memory.Open(ctx, "sqlite:///path/to/memory.db") and memory.OpenRouter work automatically.
Index ¶
- Variables
- func OpenRef(ctx context.Context, ref memory.ParsedRef) (memory.Backend, error)
- type Backend
- func (b *Backend) Close() error
- func (b *Backend) ConsolidateConversation(ctx context.Context, scope memory.ScopeMap, req memory.ConversationRequest) ([]memory.ConsolidationDelta, error)
- func (b *Backend) Delete(ctx context.Context, scope memory.ScopeMap, id string) error
- func (b *Backend) Put(ctx context.Context, scope memory.ScopeMap, req memory.PutRequest) ([]memory.ConsolidationDelta, error)
- func (b *Backend) Retrieve(ctx context.Context, scope memory.ScopeMap, req memory.RetrieveRequest) ([]memory.Item, error)
- type Option
Constants ¶
This section is empty.
Variables ¶
var ErrClosed = errors.New("sqlfts: backend is closed")
ErrClosed is returned when an operation is called on a closed Backend.
Functions ¶
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
Backend is a SQLite FTS5 implementation of pkg/memory.Backend partitioned by exact ScopeMap equality.
func Open ¶
Open opens or creates a SQLite database at dbPath, initializes the memory schema and FTS5 index, and returns a Backend.
func (*Backend) ConsolidateConversation ¶
func (b *Backend) ConsolidateConversation(ctx context.Context, scope memory.ScopeMap, req memory.ConversationRequest) ([]memory.ConsolidationDelta, error)
ConsolidateConversation extracts non-empty dialogue turns from req.Turns and consolidates them into scope.
func (*Backend) Delete ¶
Delete removes id only if it exists in scope. Cross-scope delete attempts return an error wrapping both memory.ErrScopeMismatch and memory.ErrNotFound without modifying the target item.