Phase 5 (ADR-0003). pkg/concepts fixes the epistemic vocabulary (observation, fact, memory, claim, hypothesis, belief, prediction, assumption, inference, opinion), memory kinds and relation names. internal/memory stores episodic, semantic, procedural and autobiographical memories in one mind-scoped table with trust-derived credibility, importance, salience and decaying activation. Retrieval fuses full-text rank (any-term by default), optional pgvector similarity, recency, activation, importance and credibility, and returns the component scores so every recall can be explained. Decay lowers activation and never deletes; retraction and supersession keep rows for provenance. Relationships are constrained to one mind at insert time. Embeddings live in a conditional pgvector table keyed by model so vector spaces are never mixed; without an embedder the system degrades to text and graph retrieval. Attention gates encoding: the attend handler turns admitted observations into episodic memories (operator changes become autobiographical ones) with memory_created events; the retrieve process proposes recalled memories as candidates and admitted recalls are reinforced with memory_retrieved events carrying their scoring components. Memory explorer UI (search with component breakdown, timeline, filters, operator knowledge entry), memory detail with provenance, relationships, citing events and an inaccurate-memory correction; API; noemactl memory commands; decay and embed-missing background jobs.
38 lines
1.1 KiB
Go
38 lines
1.1 KiB
Go
// Package app holds the dependency bundle shared by the HTTP API, the web UI
|
|
// and the CLI-facing services. It exists so that constructors take one typed
|
|
// value instead of a growing parameter list, without resorting to globals.
|
|
package app
|
|
|
|
import (
|
|
"io/fs"
|
|
"log/slog"
|
|
"time"
|
|
|
|
"github.com/jackc/pgx/v5/pgxpool"
|
|
|
|
"github.com/andydixon/noema/internal/audit"
|
|
"github.com/andydixon/noema/internal/auth"
|
|
"github.com/andydixon/noema/internal/brain"
|
|
"github.com/andydixon/noema/internal/config"
|
|
"github.com/andydixon/noema/internal/events"
|
|
"github.com/andydixon/noema/internal/memory"
|
|
"github.com/andydixon/noema/internal/minds"
|
|
"github.com/andydixon/noema/internal/observability"
|
|
)
|
|
|
|
// Deps is everything a handler may need. Fields are added per phase.
|
|
type Deps struct {
|
|
Config config.Config
|
|
Log *slog.Logger
|
|
DB *pgxpool.Pool
|
|
Auth *auth.Service
|
|
Audit *audit.Logger
|
|
Metrics *observability.Metrics
|
|
Minds *minds.Store
|
|
Events *events.Store
|
|
Brain *brain.Manager
|
|
Memory *memory.Store
|
|
Migrations fs.FS
|
|
Started time.Time
|
|
}
|