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

model

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LayerPersonal = "personal"
	LayerOrg      = "org"
	RoleUser      = "user"
	RoleOrg       = "org"
	LocalOwner    = "local"
)

Variables

Functions

This section is empty.

Types

type Category

type Category string

Category represents the type of an insight.

const (
	CategoryPreference Category = "preference"
	CategoryDecision   Category = "decision"
	CategoryFact       Category = "fact"
	CategoryInsight    Category = "insight"
	CategoryContext    Category = "context"
	CategoryGeneral    Category = "general"
)

type Edge

type Edge struct {
	SourceID  string            `json:"source_id"`
	TargetID  string            `json:"target_id"`
	EdgeType  EdgeType          `json:"edge_type"`
	Weight    float64           `json:"weight"`
	Metadata  map[string]string `json:"metadata"`
	CreatedAt time.Time         `json:"created_at"`
}

Edge represents a directed relationship between two insights.

func (*Edge) MetadataJSON

func (e *Edge) MetadataJSON() string

MetadataJSON returns metadata as a JSON string for storage.

func (*Edge) ParseMetadata

func (e *Edge) ParseMetadata(s string)

ParseMetadata parses a JSON string into the Metadata field.

type EdgeType

type EdgeType string

EdgeType represents the type of relationship between insights.

const (
	EdgeTemporal EdgeType = "temporal"
	EdgeSemantic EdgeType = "semantic"
	EdgeCausal   EdgeType = "causal"
	EdgeEntity   EdgeType = "entity"
)

type Insight

type Insight struct {
	ID             string     `json:"id"`
	Content        string     `json:"content"`
	Category       Category   `json:"category"`
	Importance     int        `json:"importance"`
	Tags           []string   `json:"tags"`
	Entities       []string   `json:"entities"`
	Source         string     `json:"source"`
	AccessCount    int        `json:"access_count"`
	CreatedAt      time.Time  `json:"created_at"`
	UpdatedAt      time.Time  `json:"updated_at"`
	DeletedAt      *time.Time `json:"deleted_at,omitempty"`
	OwnerPrincipal string     `json:"owner_principal"`
	Layer          string     `json:"layer"`
	ExternalRef    string     `json:"external_ref,omitempty"`
	SourceURI      string     `json:"source_uri,omitempty"`
}

Insight represents a memory node in the knowledge graph.

func (*Insight) EntitiesJSON

func (i *Insight) EntitiesJSON() string

EntitiesJSON returns entities as a JSON string for storage.

func (*Insight) ParseEntities

func (i *Insight) ParseEntities(s string)

ParseEntities parses a JSON string into the Entities field.

func (*Insight) ParseTags

func (i *Insight) ParseTags(s string)

ParseTags parses a JSON string into the Tags field.

func (*Insight) TagsJSON

func (i *Insight) TagsJSON() string

TagsJSON returns tags as a JSON string for storage.

Jump to

Keyboard shortcuts

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