server

package
v0.0.0-...-a3bda8b Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HydrateSubgraph

func HydrateSubgraph(ctx context.Context, store storage.Store, kbID string, sg graph.SubgraphResult) (*domain.Subgraph, error)

HydrateSubgraph enriches a raw SubgraphResult with entity and relation metadata from storage. Used by MCP, HTTP, and CLI graph traversal handlers.

func NewSearcher

func NewSearcher(
	store storage.Store,
	decayHalfLife float64,
	embedFn search.EmbedderFactory,
) *search.Searcher

NewSearcher is a convenience to build a Searcher from components (used by both CLI and MCP server).

func SplitCSV

func SplitCSV(s string) []string

SplitCSV splits a comma-separated string into trimmed non-empty parts.

Types

type HTTPServer

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

HTTPServer serves the memex REST API.

func NewHTTPServer

func NewHTTPServer(
	store storage.Store,
	sched *ingestion.Scheduler,
	searcher *search.Searcher,
	lcManager *lifecycle.Manager,
	consolidator *lifecycle.Consolidator,
) *HTTPServer

NewHTTPServer creates a new HTTP server with all routes registered.

func (*HTTPServer) Handler

func (s *HTTPServer) Handler() http.Handler

Handler returns the http.Handler for use with httptest or custom servers.

func (*HTTPServer) Serve

func (s *HTTPServer) Serve(ctx context.Context, addr string) error

Serve starts the HTTP server with graceful shutdown on context cancellation.

type MCPServer

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

MCPServer wraps all dependencies needed by MCP tool handlers.

func NewMCPServer

func NewMCPServer(
	store storage.Store,
	sched *ingestion.Scheduler,
	searcher *search.Searcher,
	lcManager *lifecycle.Manager,
	consolidator *lifecycle.Consolidator,
	version string,
) *MCPServer

NewMCPServer creates an MCP server with all memex tools registered.

func (*MCPServer) Run

func (s *MCPServer) Run(ctx context.Context) error

Run starts the MCP server on stdio transport. Blocks until the client disconnects.

Jump to

Keyboard shortcuts

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