service

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KanbanBoardExcluded added in v0.2.0

func KanbanBoardExcluded(excludes []string, boardID, boardName string) bool

KanbanBoardExcluded reports whether a kanban board — identified by its slug/ID (e.g. "default") and optional display name — matches any entry in the exclude list. Matching is case-insensitive and whitespace-trimmed, applied against the board ID and the board name. An empty exclude list excludes nothing (pre-configuration behaviour). A board with neither an ID nor a name never matches.

Types

type Graph added in v0.2.0

type Graph struct {
	Nodes []GraphNode `json:"nodes"`
	Edges []GraphEdge `json:"edges"`
}

Graph is the full agent graph for visualization. Nodes carry both entity kinds; edges are all five kinds, unfiltered (the renderer filters).

type GraphEdge added in v0.2.0

type GraphEdge struct {
	Source string         `json:"source"`
	Target string         `json:"target"`
	Kind   store.EdgeType `json:"kind"`
	Weight float64        `json:"weight"`
}

GraphEdge is one directed edge in the visualization graph. Source/Target reference GraphNode.ID (same id namespace so the renderer can connect them).

type GraphNode added in v0.2.0

type GraphNode struct {
	ID         string   `json:"id"`
	Kind       string   `json:"kind"` // interest_point | wiki_page
	Title      string   `json:"title"`
	Status     string   `json:"status"` // active | archived | superseded
	PageType   string   `json:"page_type,omitempty"`
	Importance float64  `json:"importance,omitempty"`
	Subjective bool     `json:"subjective,omitempty"`
	Tags       []string `json:"tags,omitempty"`
}

GraphNode is one node in the visualization graph (interest point or wiki page) with the fields a renderer needs — no body/summary/claims (those would balloon the payload on 10k+ node graphs).

type Service

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

Service orchestrates the full memory pipeline: it wires the domain services together and exposes the operations the worker queue and HTTP layer call.

func New

func New(
	cfg config.Config,
	st store.Store,
	vi vec.VectorIndex,
	llmClient *llm.Client,
	embedder *llm.Embedder,
	extraWebTools ...websearch.Tool,
) *Service

New wires the domain services from config + infrastructure. extraWebTools are optional additional network tools registered alongside the default "myagent" tool (selected via verify.web_tool).

func (*Service) Close added in v0.2.0

func (s *Service) Close()

Close releases external resources (MCP server connections) and flushes any pending token-usage deltas. Safe to call once.

func (*Service) ForkManual

func (s *Service) ForkManual(ctx context.Context, agentID string) (*store.Transcript, error)

ForkManual is invoked by POST /fork: pull the oldest unprocessed transcript and return it (the worker will process it).

func (*Service) GetByID

func (s *Service) GetByID(ctx context.Context, agentID, id string) (*recall.Result, error)

GetByID fetches one entity (page or interest point) with full content + edges for the consumer-side memory_search id lookup. Wiki pages resolve to nil when the wiki stage is disabled.

func (*Service) KanbanBoardExcluded added in v0.2.0

func (s *Service) KanbanBoardExcluded(boardID, boardName string) bool

KanbanBoardExcluded is the Service-level wrapper: it consults the configured interestmemory.kanban_exclude list. Used by the HTTP layer to drop excluded boards before any storage / embedding / token accounting.

func (*Service) ListGraph added in v0.2.0

func (s *Service) ListGraph(ctx context.Context, agentID string) (*Graph, error)

ListGraph assembles the full visualization graph for an agent: interest points + wiki pages (medium node fields) and all edges. Interest-point and wiki ids are different namespaces that can theoretically collide, so when an id appears in both, node ids and edge endpoints are prefixed with their kind (interest_point:/wiki_page:) to keep the graph unambiguous. Edges whose endpoint id matches no node are dropped (they'd dangle).

func (*Service) ListInterestPoints

func (s *Service) ListInterestPoints(ctx context.Context, agentID string) ([]store.InterestPoint, error)

ListInterestPoints returns all interest points for an agent.

func (*Service) ListLogs

func (s *Service) ListLogs(ctx context.Context, agentID string, limit, offset int) ([]store.ChangeLog, error)

ListLogs returns change logs for an agent, newest first, paginated.

func (*Service) ListPages

func (s *Service) ListPages(ctx context.Context, agentID string, pageType store.PageType) ([]store.Page, error)

ListPages returns wiki pages for an agent, optionally filtered by type.

func (s *Service) ListPendingLinks(ctx context.Context, agentID string) ([]store.PendingLink, error)

ListPendingLinks returns dead-link records for an agent.

func (*Service) ProcessSession

func (s *Service) ProcessSession(ctx context.Context, agentID string, t store.Transcript) error

ProcessSession runs the full pipeline for one pushed transcript (steps 1-7). Returns an error that aborts the run; the caller decides whether to mark the transcript processed.

func (*Service) Recall

func (s *Service) Recall(ctx context.Context, agentID, query string, opts recall.Options) (string, error)

Recall wraps the recall service, filling configured defaults for fields the caller did not set (topK/includeWiki/minScore, temporal filters passthrough).

func (*Service) SaveTranscript

func (s *Service) SaveTranscript(ctx context.Context, t store.Transcript) error

SaveTranscript persists a pushed session-end transcript.

func (*Service) Search

func (s *Service) Search(ctx context.Context, agentID, query string, topK int) ([]recall.Result, error)

Search is the consumer-side memory_search: structured hits with full content + edges (see recall.Result). topK<=0 falls back to config. Wiki pages are filtered out when the wiki stage is disabled.

func (*Service) Stats

func (s *Service) Stats(ctx context.Context, agentID string) (map[string]int, error)

Stats returns simple counts for an agent.

func (*Service) Usage added in v0.2.0

func (s *Service) Usage(ctx context.Context, since string) ([]store.UsageRow, error)

Usage returns per-day token usage from (inclusive) a date onward (YYYY-MM-DD). An empty since returns all days, oldest first.

Jump to

Keyboard shortcuts

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