Documentation
¶
Overview ¶
Package ladym is the Go SDK facade for LadyM — a brain-inspired, multi-tier memory framework for LLM agents and codebase RAG.
Usage:
eng, err := ladym.NewEngine(ladym.DefaultConfig())
eng.IndexCode("./src", false, "", nil)
resp, _ := eng.Recall("how does auth work", "", 0, nil, nil, 0)
Index ¶
- Constants
- func DefaultConfig() *config.Config
- func IndexCode(root, dbPath, workspace string, force bool) (*code.IndexReport, error)
- func KnowledgeFingerprint(m *Memory) string
- func NamedOps() []string
- func NewEngine(cfg *config.Config) (*engine.Engine, error)
- func NewEngineWithModels(cfg *config.Config, models *adapter.ModelRouting) (*engine.Engine, error)
- func OpenEngine(cfg *config.Config, dbPath, workspace string, fn func(*engine.Engine) error) error
- func Recall(query, dbPath, workspace string, topK int) (*schema.RecallResponse, error)
- func RecallOperations(q OperationsQuery, dbPath, workspace string) (*engine.OperationsResponse, error)
- func RecordOperation(ev OperationEvent, dbPath, workspace string) (*schema.Memory, error)
- func Remember(content, dbPath, workspace string, tags []string, source string) (*schema.Memory, error)
- type ActivationWeights
- type ArchiveConfig
- type BootstrapRequest
- type BootstrapResponse
- type BuildTopicRequest
- type CallOptions
- type Claim
- type ClaimFeedback
- type ClaimFeedbackRequest
- type ClaimScope
- type CodeIndexConfig
- type CodeSymbol
- type Config
- type ConsolidateConfig
- type ContextEmbeddingProvider
- type ContextLLMProvider
- type CreateClaimRequest
- type Edge
- type Engine
- type EvidenceRef
- type HybridRecallRequest
- type Layer
- type MaintenanceJob
- type MaintenanceReport
- type Memory
- type MemoryType
- type ModelRouting
- type OperationEvent
- type OperationsQuery
- type OperationsResponse
- type RecallConfig
- type RecallResponse
- type RecallResult
- type RecordEvidenceRequest
- type ScheduleMaintenanceRequest
- type Scope
- type SetTaskStateRequest
- type Stats
- type StructuredResult
- type System2Config
- type TokenCounter
- type Verification
Constants ¶
const ( LayerWorking = schema.LayerWorking LayerEpisodic = schema.LayerEpisodic LayerSemantic = schema.LayerSemantic LayerProcedural = schema.LayerProcedural LayerAssociative = schema.LayerAssociative LayerL5Mental = schema.LayerL5Mental LayerL6Predictive = schema.LayerL6Predictive )
Layer constants.
const ( TypeNote = schema.TypeNote TypeEvent = schema.TypeEvent TypeFact = schema.TypeFact TypeCodeFile = schema.TypeCodeFile TypeCodeSymbol = schema.TypeCodeSymbol TypePlaybook = schema.TypePlaybook TypeSnippet = schema.TypeSnippet TypeMentalModel = schema.TypeMentalModel TypeForwardIntent = schema.TypeForwardIntent TypeClaim = schema.TypeClaim TypeEvidence = schema.TypeEvidence TypeTopicView = schema.TypeTopicView TypeTaskState = schema.TypeTaskState TypeMaintenanceJob = schema.TypeMaintenanceJob )
MemoryType constants.
const Version = "0.5.2"
Version is the LadyM version.
Variables ¶
This section is empty.
Functions ¶
func DefaultConfig ¶
DefaultConfig returns a Config with all defaults populated.
func IndexCode ¶
func IndexCode(root, dbPath, workspace string, force bool) (*code.IndexReport, error)
IndexCode is a one-shot codebase index.
func KnowledgeFingerprint ¶ added in v0.9.0
func NamedOps ¶
func NamedOps() []string
NAMED_OPS mirrors providers.NAMED_OPS (the cognitive operations that can bind an LLM provider). A copy is returned so callers cannot mutate the registry.
func NewEngineWithModels ¶
NewEngineWithModels builds an Engine injecting host-owned models.
func OpenEngine ¶
OpenEngine runs fn with a short-lived Engine, closing it on return. It is the Go equivalent of Python's `open_engine` context manager. Overrides apply to a shallow copy without changing cfg's DBPath or Workspace.
func Recall ¶
func Recall(query, dbPath, workspace string, topK int) (*schema.RecallResponse, error)
Recall is a one-shot recall. Returns a RecallResponse.
func RecallOperations ¶ added in v0.7.0
func RecallOperations(q OperationsQuery, dbPath, workspace string) (*engine.OperationsResponse, error)
RecallOperations is a one-shot recall_ops pivot query: which operations touched a resource, narrowed by action / time window / outcome. A resource miss degrades to plain recall with Fallback=true.
func RecordOperation ¶ added in v0.7.0
func RecordOperation(ev OperationEvent, dbPath, workspace string) (*schema.Memory, error)
RecordOperation is a one-shot structured L1 write: the action is normalized onto the vocabulary, each resource is resolved to a workspace entity, and an operates_on edge links the episode to every resource.
Types ¶
type ActivationWeights ¶
type ActivationWeights = config.ActivationWeights
Re-export the public types for a one-import SDK surface.
type ArchiveConfig ¶ added in v0.9.0
type ArchiveConfig = config.ArchiveConfig
Re-export the public types for a one-import SDK surface.
type BootstrapRequest ¶ added in v0.9.0
type BootstrapRequest = schema.BootstrapRequest
Re-export the public types for a one-import SDK surface.
type BootstrapResponse ¶ added in v0.9.0
type BootstrapResponse = schema.BootstrapResponse
Re-export the public types for a one-import SDK surface.
type BuildTopicRequest ¶ added in v0.9.0
type BuildTopicRequest = schema.BuildTopicRequest
Re-export the public types for a one-import SDK surface.
type CallOptions ¶ added in v0.9.0
type CallOptions = providers.CallOptions
Re-export the public types for a one-import SDK surface.
type ClaimFeedback ¶ added in v0.9.0
type ClaimFeedback = schema.ClaimFeedback
Re-export the public types for a one-import SDK surface.
type ClaimFeedbackRequest ¶ added in v0.9.0
type ClaimFeedbackRequest = schema.ClaimFeedbackRequest
Re-export the public types for a one-import SDK surface.
type ClaimScope ¶ added in v0.9.0
type ClaimScope = schema.ClaimScope
Re-export the public types for a one-import SDK surface.
type CodeIndexConfig ¶
type CodeIndexConfig = config.CodeIndexConfig
Re-export the public types for a one-import SDK surface.
type CodeSymbol ¶
type CodeSymbol = schema.CodeSymbol
Re-export the public types for a one-import SDK surface.
type ConsolidateConfig ¶
type ConsolidateConfig = config.ConsolidateConfig
Re-export the public types for a one-import SDK surface.
type ContextEmbeddingProvider ¶ added in v0.9.0
type ContextEmbeddingProvider = storage.ContextEmbeddingProvider
Re-export the public types for a one-import SDK surface.
type ContextLLMProvider ¶ added in v0.9.0
type ContextLLMProvider = providers.ContextLLMProvider
Re-export the public types for a one-import SDK surface.
type CreateClaimRequest ¶ added in v0.9.0
type CreateClaimRequest = schema.CreateClaimRequest
Re-export the public types for a one-import SDK surface.
type EvidenceRef ¶ added in v0.9.0
type EvidenceRef = schema.EvidenceRef
Re-export the public types for a one-import SDK surface.
type HybridRecallRequest ¶ added in v0.9.0
type HybridRecallRequest = schema.HybridRecallRequest
Re-export the public types for a one-import SDK surface.
type MaintenanceJob ¶ added in v0.9.0
type MaintenanceJob = schema.MaintenanceJob
Re-export the public types for a one-import SDK surface.
type MaintenanceReport ¶ added in v0.9.0
type MaintenanceReport = schema.MaintenanceReport
Re-export the public types for a one-import SDK surface.
type MemoryType ¶
type MemoryType = schema.MemoryType
Re-export the public types for a one-import SDK surface.
type ModelRouting ¶
type ModelRouting = adapter.ModelRouting
Re-export the public types for a one-import SDK surface.
type OperationEvent ¶ added in v0.7.0
type OperationEvent = engine.OperationEvent
Re-export the public types for a one-import SDK surface.
type OperationsQuery ¶ added in v0.7.0
type OperationsQuery = engine.OperationsQuery
Re-export the public types for a one-import SDK surface.
type OperationsResponse ¶ added in v0.7.0
type OperationsResponse = engine.OperationsResponse
Re-export the public types for a one-import SDK surface.
type RecallConfig ¶
type RecallConfig = config.RecallConfig
Re-export the public types for a one-import SDK surface.
type RecallResponse ¶
type RecallResponse = schema.RecallResponse
Re-export the public types for a one-import SDK surface.
type RecallResult ¶
type RecallResult = schema.RecallResult
Re-export the public types for a one-import SDK surface.
type RecordEvidenceRequest ¶ added in v0.9.0
type RecordEvidenceRequest = schema.RecordEvidenceRequest
Re-export the public types for a one-import SDK surface.
type ScheduleMaintenanceRequest ¶ added in v0.9.0
type ScheduleMaintenanceRequest = schema.ScheduleMaintenanceRequest
Re-export the public types for a one-import SDK surface.
type SetTaskStateRequest ¶ added in v0.9.0
type SetTaskStateRequest = schema.SetTaskStateRequest
Re-export the public types for a one-import SDK surface.
type StructuredResult ¶ added in v0.9.0
type StructuredResult = providers.StructuredResult
Re-export the public types for a one-import SDK surface.
type System2Config ¶ added in v0.9.0
type System2Config = config.System2Config
Re-export the public types for a one-import SDK surface.
type TokenCounter ¶ added in v0.9.0
type TokenCounter = engine.TokenCounter
Re-export the public types for a one-import SDK surface.
type Verification ¶ added in v0.9.0
type Verification = schema.Verification
Re-export the public types for a one-import SDK surface.