Documentation
¶
Index ¶
- func AddContract() error
- type Evidence
- type EvidenceInput
- type Memory
- type RecallTier
- type Service
- func (s *Service) CreateFactWithEvidence(mem *Memory, evidences []EvidenceInput, ...) error
- func (s *Service) CreateMemory(memory *Memory) error
- func (s *Service) GetAllMemories(projectID string) ([]*Memory, error)
- func (s *Service) GetMemory(id int64, projectID string) (*Memory, error)
- func (s *Service) MarkAsSuperseded(oldID, newID int64) error
- func (s *Service) PromoteToFact(memoryID int64, projectID string, isValidated bool) error
- func (s *Service) SearchMemories(projectID string, searchTerm string, limit int) ([]*Memory, error)
- func (s *Service) UpdateMemory(memory *Memory) error
- type TruthState
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddContract ¶
func AddContract() error
AddContract adds the MANDATORY TINYMEM CONTROL PROTOCOL to agent markdown files
Types ¶
type Evidence ¶
type Evidence struct {
ID int64 `json:"id"`
MemoryID int64 `json:"memory_id"`
Type string `json:"type"`
Content string `json:"content"`
Verified bool `json:"verified"`
CreatedAt time.Time `json:"created_at"`
}
Evidence represents evidence for a memory
type EvidenceInput ¶
EvidenceInput represents evidence input for creating a fact.
type Memory ¶
type Memory struct {
ID int64 `json:"id"`
ProjectID string `json:"project_id"`
Type Type `json:"type"`
Summary string `json:"summary"`
Detail string `json:"detail"`
Key *string `json:"key,omitempty"`
Source *string `json:"source,omitempty"`
RecallTier RecallTier `json:"recall_tier"`
TruthState TruthState `json:"truth_state"`
Classification *string `json:"classification,omitempty"` // Optional classification for better recall precision
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
SupersededBy *int64 `json:"superseded_by,omitempty"`
}
Memory represents a memory entry
type RecallTier ¶
type RecallTier string
RecallTier represents the recall tier of a memory
const ( Always RecallTier = "always" Contextual RecallTier = "contextual" Opportunistic RecallTier = "opportunistic" )
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service handles memory operations
func (*Service) CreateFactWithEvidence ¶
func (s *Service) CreateFactWithEvidence(mem *Memory, evidences []EvidenceInput, verify func(string, string) (bool, error)) error
CreateFactWithEvidence creates a fact only when evidence is verified.
func (*Service) CreateMemory ¶
CreateMemory creates a new memory entry
func (*Service) GetAllMemories ¶
GetAllMemories retrieves all memories for a project
func (*Service) MarkAsSuperseded ¶
MarkAsSuperseded marks a memory as superseded by another
func (*Service) PromoteToFact ¶
PromoteToFact promotes a memory to fact type after verifying evidence
func (*Service) SearchMemories ¶
SearchMemories performs a full-text search on memories
func (*Service) UpdateMemory ¶
UpdateMemory updates an existing memory entry
type TruthState ¶
type TruthState string
TruthState represents the truth state of a memory
const ( Tentative TruthState = "tentative" Asserted TruthState = "asserted" Verified TruthState = "verified" )
type Type ¶
type Type string
Type represents the type of memory entry
func (Type) RequiresEvidence ¶
Validation rules for memory types