memory

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GonchoMemoryV1ContractVersion = "1"
	GonchoMemoryV1MarkdownFormat  = "1"
	GonchoMemoryV1MCPToolContract = "1"
)
View Source
const (
	CrossChatDecisionAllowed  = "allowed"
	CrossChatDecisionDenied   = "denied"
	CrossChatDecisionDegraded = "degraded"
	CrossChatFallbackSameChat = "same-chat"
)

Variables

This section is empty.

Functions

func CanRecallGonchoMemoryV1

func CanRecallGonchoMemoryV1(req GonchoMemoryV1RecallRequest, item GonchoMemoryV1Item) (bool, string)

func GonchoMemoryV1Checksum

func GonchoMemoryV1Checksum(content string) string

func RenderGonchoMemoryV1Markdown

func RenderGonchoMemoryV1Markdown(doc GonchoMemoryV1Document) (string, error)

func ValidateGonchoMemoryV1Item

func ValidateGonchoMemoryV1Item(item GonchoMemoryV1Item) error

Types

type GonchoMarkdownConflict

type GonchoMarkdownConflict struct {
	MemoryID string
	Reason   string
}

type GonchoMarkdownExportResult

type GonchoMarkdownExportResult struct {
	Exported        int
	NetworkRequired bool
	OllamaRequired  bool
}

type GonchoMarkdownReloadResult

type GonchoMarkdownReloadResult struct {
	Inserted        int
	Updated         int
	Tombstoned      int
	Conflicts       []GonchoMarkdownConflict
	NetworkRequired bool
	OllamaRequired  bool
}

type GonchoMarkdownStore

type GonchoMarkdownStore struct {
	Config GonchoMarkdownStoreConfig
	// contains filtered or unexported fields
}

func NewGonchoMarkdownStore

func NewGonchoMarkdownStore(db *sql.DB, cfg GonchoMarkdownStoreConfig) *GonchoMarkdownStore

func (*GonchoMarkdownStore) Export

func (*GonchoMarkdownStore) Reload

type GonchoMarkdownStoreConfig

type GonchoMarkdownStoreConfig struct {
	Path                  string
	DefaultObserverPeerID string
}

type GonchoMemoryV1Document

type GonchoMemoryV1Document struct {
	FormatVersion   string               `json:"format_version"`
	ContractVersion string               `json:"contract_version"`
	Items           []GonchoMemoryV1Item `json:"items"`
}

func ParseGonchoMemoryV1Markdown

func ParseGonchoMemoryV1Markdown(body []byte) (GonchoMemoryV1Document, error)

type GonchoMemoryV1Item

type GonchoMemoryV1Item struct {
	MemoryID        string   `json:"memory_id" yaml:"memory_id"`
	Revision        int      `json:"revision" yaml:"revision"`
	AgentID         string   `json:"agent_id" yaml:"agent_id"`
	WorkspaceID     string   `json:"workspace_id" yaml:"workspace_id"`
	PeerID          string   `json:"peer_id" yaml:"peer_id"`
	SessionID       string   `json:"session_id" yaml:"session_id"`
	Scope           string   `json:"scope" yaml:"scope"`
	State           string   `json:"state" yaml:"state"`
	SourceKind      string   `json:"source_kind" yaml:"source_kind"`
	SourceTurnID    string   `json:"source_turn_id,omitempty" yaml:"source_turn_id,omitempty"`
	TombstonedAt    string   `json:"tombstoned_at,omitempty" yaml:"tombstoned_at,omitempty"`
	TombstoneReason string   `json:"tombstone_reason,omitempty" yaml:"tombstone_reason,omitempty"`
	Checksum        string   `json:"checksum" yaml:"checksum"`
	Tags            []string `json:"tags,omitempty" yaml:"tags,omitempty"`
	Importance      float64  `json:"importance" yaml:"importance"`
	CreatedAt       string   `json:"created_at" yaml:"created_at"`
	UpdatedAt       string   `json:"updated_at" yaml:"updated_at"`
	ProvenanceJSON  string   `json:"provenance_json,omitempty" yaml:"provenance_json,omitempty"`
	Content         string   `json:"content" yaml:"-"`
}

type GonchoMemoryV1RecallRequest

type GonchoMemoryV1RecallRequest struct {
	AgentID     string
	WorkspaceID string
	AllowShared bool
}

type SqliteStore

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

func OpenSqlite

func OpenSqlite(path string, _ int, _ *slog.Logger) (*SqliteStore, error)

func (*SqliteStore) Close

func (s *SqliteStore) Close(ctx context.Context) error

func (*SqliteStore) DB

func (s *SqliteStore) DB() *sql.DB

Jump to

Keyboard shortcuts

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