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

profile

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProfileStore

type ProfileStore struct {
	// contains filtered or unexported fields
}

ProfileStore manages multiple Soul profiles.

func NewProfileStore

func NewProfileStore() *ProfileStore

func (*ProfileStore) Get

func (ps *ProfileStore) Get(userID string) *Soul

Get returns an existing profile or nil.

func (*ProfileStore) GetOrCreate

func (ps *ProfileStore) GetOrCreate(userID string) *Soul

GetOrCreate returns the profile for a user, creating if needed.

type Soul

type Soul struct {
	UserID string            `json:"user_id"`
	Traits map[string]*Trait `json:"traits"` // key → Trait
	// contains filtered or unexported fields
}

Soul aggregates patterns from memories into a user/agent profile.

func NewSoul

func NewSoul(userID string) *Soul

func (*Soul) Count

func (s *Soul) Count() int

Count returns the number of traits.

func (*Soul) Get

func (s *Soul) Get(key string) (*Trait, bool)

Get returns a trait by key.

func (*Soul) Observe

func (s *Soul) Observe(key, value string)

Observe records a trait observation. If the trait exists, increments count; otherwise creates it.

func (*Soul) Summary

func (s *Soul) Summary() string

Summary produces a text description of the profile.

func (*Soul) TopTraits

func (s *Soul) TopTraits(n int) []*Trait

TopTraits returns the N most frequently observed traits.

type Trait

type Trait struct {
	Key         string    `json:"key"`
	Value       string    `json:"value"`
	Occurrences int       `json:"occurrences"`
	FirstSeen   time.Time `json:"first_seen"`
	LastSeen    time.Time `json:"last_seen"`
}

Trait captures a single behavioral or preference pattern.

Jump to

Keyboard shortcuts

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