server

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2026 License: MIT Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package server implements MCP and REST API transports for Engram.

Index

Constants

View Source
const DefaultExpiryInterval = 10 * time.Minute

DefaultExpiryInterval is the default period between expiry cleanup runs.

Variables

This section is empty.

Functions

func StartExpiryCleanup

func StartExpiryCleanup(ctx context.Context, store memory.Store, interval time.Duration)

StartExpiryCleanup launches a background goroutine that periodically deletes expired memories (valid_until > 0 && valid_until < now) from the store.

The goroutine respects ctx cancellation and stops cleanly when ctx is done. interval controls how often cleanup runs (default: 10 minutes). Pass 0 to use DefaultExpiryInterval.

The first run happens after one full interval (not immediately at startup) to avoid competing with the startup sequence.

Types

type Server

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

Server wraps the MCP server with Engram's memory operations.

func NewServer

func NewServer(store memory.Store, embedder embedding.Embedder, cfg *config.Config) *Server

NewServer creates a new Engram MCP server with all tools registered.

func (*Server) GetMCPServer

func (s *Server) GetMCPServer() *mcpserver.MCPServer

GetMCPServer returns the underlying mcp-go server for testing or advanced use.

func (*Server) ServeStdio

func (s *Server) ServeStdio() error

ServeStdio starts the server using stdio transport (for MCP clients).

Jump to

Keyboard shortcuts

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