Documentation
¶
Index ¶
- type EmbeddingConfig
- type PostgresStore
- func (s *PostgresStore) AddAuditEntry(ctx context.Context, id string, entry schema.AuditEntry) error
- func (s *PostgresStore) AddRelation(ctx context.Context, sourceID string, rel schema.Relation) error
- func (s *PostgresStore) Begin(ctx context.Context) (storage.Transaction, error)
- func (s *PostgresStore) ClaimUnextractedEpisodics(ctx context.Context, limit int) ([]string, error)
- func (s *PostgresStore) CleanStaleExtractionClaims(ctx context.Context, olderThan time.Duration) error
- func (s *PostgresStore) Close() error
- func (s *PostgresStore) Create(ctx context.Context, rec *schema.MemoryRecord) error
- func (s *PostgresStore) Delete(ctx context.Context, id string) error
- func (s *PostgresStore) FindSemanticExact(ctx context.Context, subject, predicate, object string) (*schema.MemoryRecord, error)
- func (s *PostgresStore) Get(ctx context.Context, id string) (*schema.MemoryRecord, error)
- func (s *PostgresStore) GetRelations(ctx context.Context, id string) ([]schema.Relation, error)
- func (s *PostgresStore) GetTriggerEmbedding(ctx context.Context, recordID string) ([]float32, error)
- func (s *PostgresStore) List(ctx context.Context, opts storage.ListOptions) ([]*schema.MemoryRecord, error)
- func (s *PostgresStore) ListByType(ctx context.Context, memType schema.MemoryType) ([]*schema.MemoryRecord, error)
- func (s *PostgresStore) MarkEpisodicExtracted(ctx context.Context, recordID string, tripleCount int) error
- func (s *PostgresStore) ReleaseEpisodicClaim(ctx context.Context, recordID string) error
- func (s *PostgresStore) Reset(ctx context.Context) error
- func (s *PostgresStore) SearchByEmbedding(ctx context.Context, query []float32, limit int) ([]string, error)
- func (s *PostgresStore) StoreTriggerEmbedding(ctx context.Context, recordID string, embedding []float32, model string) error
- func (s *PostgresStore) Update(ctx context.Context, rec *schema.MemoryRecord) error
- func (s *PostgresStore) UpdateSalience(ctx context.Context, id string, salience float64) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EmbeddingConfig ¶
EmbeddingConfig controls the vector schema created for Postgres-backed stores.
type PostgresStore ¶
type PostgresStore struct {
// contains filtered or unexported fields
}
PostgresStore implements storage.Store backed by PostgreSQL plus pgvector.
func Open ¶
func Open(dsn string, cfg EmbeddingConfig) (*PostgresStore, error)
Open creates a new PostgresStore and ensures the schema exists.
func (*PostgresStore) AddAuditEntry ¶
func (s *PostgresStore) AddAuditEntry(ctx context.Context, id string, entry schema.AuditEntry) error
func (*PostgresStore) AddRelation ¶
func (*PostgresStore) Begin ¶
func (s *PostgresStore) Begin(ctx context.Context) (storage.Transaction, error)
func (*PostgresStore) ClaimUnextractedEpisodics ¶
ClaimUnextractedEpisodics atomically claims up to limit episodic records for semantic extraction and returns their record IDs.
func (*PostgresStore) CleanStaleExtractionClaims ¶
func (s *PostgresStore) CleanStaleExtractionClaims(ctx context.Context, olderThan time.Duration) error
CleanStaleExtractionClaims deletes in-flight claims older than olderThan.
func (*PostgresStore) Close ¶
func (s *PostgresStore) Close() error
Close closes the underlying database connection.
func (*PostgresStore) Create ¶
func (s *PostgresStore) Create(ctx context.Context, rec *schema.MemoryRecord) error
func (*PostgresStore) FindSemanticExact ¶
func (s *PostgresStore) FindSemanticExact(ctx context.Context, subject, predicate, object string) (*schema.MemoryRecord, error)
FindSemanticExact retrieves a semantic record by exact subject-predicate-object match.
func (*PostgresStore) Get ¶
func (s *PostgresStore) Get(ctx context.Context, id string) (*schema.MemoryRecord, error)
func (*PostgresStore) GetRelations ¶
func (*PostgresStore) GetTriggerEmbedding ¶
func (s *PostgresStore) GetTriggerEmbedding(ctx context.Context, recordID string) ([]float32, error)
GetTriggerEmbedding retrieves the stored embedding for a record.
func (*PostgresStore) List ¶
func (s *PostgresStore) List(ctx context.Context, opts storage.ListOptions) ([]*schema.MemoryRecord, error)
func (*PostgresStore) ListByType ¶
func (s *PostgresStore) ListByType(ctx context.Context, memType schema.MemoryType) ([]*schema.MemoryRecord, error)
func (*PostgresStore) MarkEpisodicExtracted ¶
func (s *PostgresStore) MarkEpisodicExtracted(ctx context.Context, recordID string, tripleCount int) error
MarkEpisodicExtracted marks a claimed episodic record as fully processed.
func (*PostgresStore) ReleaseEpisodicClaim ¶
func (s *PostgresStore) ReleaseEpisodicClaim(ctx context.Context, recordID string) error
ReleaseEpisodicClaim clears an in-flight extraction claim so the episode can be retried.
func (*PostgresStore) Reset ¶
func (s *PostgresStore) Reset(ctx context.Context) error
Reset deletes all stored records and embeddings. Intended for tests and local evaluation flows.
func (*PostgresStore) SearchByEmbedding ¶
func (s *PostgresStore) SearchByEmbedding(ctx context.Context, query []float32, limit int) ([]string, error)
SearchByEmbedding returns record IDs ordered by cosine distance ascending.
func (*PostgresStore) StoreTriggerEmbedding ¶
func (s *PostgresStore) StoreTriggerEmbedding(ctx context.Context, recordID string, embedding []float32, model string) error
StoreTriggerEmbedding stores or updates a trigger embedding for a record.
func (*PostgresStore) Update ¶
func (s *PostgresStore) Update(ctx context.Context, rec *schema.MemoryRecord) error