Documentation
¶
Index ¶
- Constants
- Variables
- func ChunkText(text string, maxRunes, overlap int) []string
- func QuantizeI8(v []float32) ([]byte, error)
- type Config
- type DBStats
- type Edge
- type Embedder
- type IntegrityReport
- type MemoryInput
- type MemoryResult
- type Node
- type NoopEmbedder
- type PotionEmbedder
- type SearchOptions
- type SearchResult
- type Store
- func (s *Store) AddMemory(ctx context.Context, in MemoryInput) (MemoryResult, error)
- func (s *Store) CheckIntegrity(ctx context.Context) (IntegrityReport, error)
- func (s *Store) Close() error
- func (s *Store) DB() *sql.DB
- func (s *Store) DefaultSearchOptions() SearchOptions
- func (s *Store) DeleteDocument(ctx context.Context, documentID int64) error
- func (s *Store) DeleteKV(ctx context.Context, namespace, key string) error
- func (s *Store) GetKV(ctx context.Context, namespace, key string) ([]byte, error)
- func (s *Store) LinkChunkNode(ctx context.Context, chunkID, nodeID int64, weight float64) error
- func (s *Store) Neighbors(ctx context.Context, nodeID int64, relation *int, limit int) ([]Node, error)
- func (s *Store) Optimize(ctx context.Context) error
- func (s *Store) PutKV(ctx context.Context, namespace, key string, value []byte) error
- func (s *Store) RebuildFTS(ctx context.Context) error
- func (s *Store) Search(ctx context.Context, query string, opts SearchOptions) ([]SearchResult, error)
- func (s *Store) Stats(ctx context.Context) (DBStats, error)
- func (s *Store) UpsertEdge(ctx context.Context, e Edge) error
- func (s *Store) UpsertNode(ctx context.Context, n Node) (int64, error)
- func (s *Store) Vacuum(ctx context.Context) error
- func (s *Store) Walk(ctx context.Context, startID int64, depth, limit int) ([]Node, error)
Constants ¶
View Source
const ( EmbeddingPending = iota EmbeddingIndexed EmbeddingRetry EmbeddingDisabled )
View Source
const VectorDimensions = 64
Variables ¶
View Source
var ( ErrNotFound = errors.New("micrographrag: not found") ErrZeroVector = errors.New("micrographrag: zero vector") ErrVectorDisabled = errors.New("micrographrag: vector search disabled") ErrFTSDisabled = errors.New("micrographrag: fts disabled") ErrGraphDisabled = errors.New("micrographrag: graph disabled") )
Functions ¶
func QuantizeI8 ¶
Types ¶
type Config ¶
type Config struct {
DBPath string
SQLiteCacheKB int
BusyTimeout time.Duration
EnableWAL bool
EnableFTS bool
EnableVector bool
EnableGraph bool
FTSLimit int
VectorLimit int
HybridLimit int
GraphDepth int
GraphMaxNodes int
MaxChunkRunes int
ChunkOverlap int
EmbeddingPollInterval time.Duration
EmbeddingMaxAttempts int
EnableEmbeddingWorker bool
}
func DefaultConfig ¶
type IntegrityReport ¶
type MemoryInput ¶
type MemoryResult ¶
type NoopEmbedder ¶
type NoopEmbedder struct{}
func (NoopEmbedder) Close ¶
func (NoopEmbedder) Close() error
func (NoopEmbedder) Dimensions ¶
func (NoopEmbedder) Dimensions() int
type PotionEmbedder ¶
type PotionEmbedder struct {
// contains filtered or unexported fields
}
func NewPotionEmbedder ¶
func NewPotionEmbedder(ctx context.Context) (*PotionEmbedder, error)
NewPotionEmbedder loads potion-base-2M (64 dimensions). If GO_POTION_HOME already contains BASE2M/model.safetensors and BASE2M/tokenizer.json, no network access is performed. This is the recommended deployment mode.
func (*PotionEmbedder) Close ¶
func (p *PotionEmbedder) Close() error
func (*PotionEmbedder) Dimensions ¶
func (p *PotionEmbedder) Dimensions() int
type SearchOptions ¶
type SearchResult ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) AddMemory ¶
func (s *Store) AddMemory(ctx context.Context, in MemoryInput) (MemoryResult, error)
func (*Store) CheckIntegrity ¶
func (s *Store) CheckIntegrity(ctx context.Context) (IntegrityReport, error)
func (*Store) DefaultSearchOptions ¶
func (s *Store) DefaultSearchOptions() SearchOptions
func (*Store) DeleteDocument ¶
func (*Store) LinkChunkNode ¶
func (*Store) Search ¶
func (s *Store) Search(ctx context.Context, query string, opts SearchOptions) ([]SearchResult, error)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.