Documentation
¶
Index ¶
- func CreateComponents(cfg *Config, logger *slog.Logger) (contextstore.ContextStore, summarizer.Summarizer, vector.Embedder, error)
- func GenerateHash(summary string, timestamp int64) string
- func SaveConfig(config *Config, path string) ([]byte, error)
- type Config
- type Server
- func (s *Server) GetEmbedder() vector.Embedder
- func (s *Server) GetStore() contextstore.ContextStore
- func (s *Server) GetSummarizer() summarizer.Summarizer
- func (s *Server) RetrieveContext(query string, limit int) ([]string, error)
- func (s *Server) SaveContext(text string) (string, error)
- func (s *Server) Start() error
- func (s *Server) Stop() error
- type ServerOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateComponents ¶
func CreateComponents(cfg *Config, logger *slog.Logger) (contextstore.ContextStore, summarizer.Summarizer, vector.Embedder, error)
CreateComponents creates and initializes the components of the ProjectMemory service without creating a server instance. This is useful for components that need direct access to the store, summarizer, and embedder.
func GenerateHash ¶
GenerateHash creates a hash from the summary and a timestamp This is a convenience wrapper around the internal util.GenerateHash function
Types ¶
type Config ¶
Config represents the configuration for the ProjectMemory service.
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns the default configuration for the ProjectMemory service.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents the ProjectMemory service.
func NewServer ¶
func NewServer(opts ServerOptions) (*Server, error)
NewServer creates a new ProjectMemory Server with the given options. If opts.Config is provided, it will be used directly. Otherwise, if opts.ConfigPath is provided, configuration will be loaded from that path. If neither is provided, DefaultConfig() will be used. If opts.Logger is nil, slog.Default() will be used.
func (*Server) GetEmbedder ¶
GetEmbedder returns the embedder instance used by the server.
func (*Server) GetStore ¶
func (s *Server) GetStore() contextstore.ContextStore
GetStore returns the context store instance used by the server.
func (*Server) GetSummarizer ¶
func (s *Server) GetSummarizer() summarizer.Summarizer
GetSummarizer returns the summarizer instance used by the server.
func (*Server) RetrieveContext ¶
RetrieveContext retrieves context entries similar to the given query.
func (*Server) SaveContext ¶
SaveContext saves the given text to the context store.
type ServerOptions ¶ added in v0.1.4
type ServerOptions struct {
Config *Config // Pre-filled config. If nil, ConfigPath is used.
ConfigPath string // Path to config file. Used if Config is nil. If both are empty, DefaultConfig() is used.
Logger *slog.Logger // External logger. If nil, slog.Default() is used.
}
ServerOptions defines the options for creating a new Server.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
projectmemory
command
|
|
|
examples
|
|
|
embed-in-mcp
command
|
|
|
internal
|
|
|
contextstore
Package contextstore provides the storage components for the context data used by the ProjectMemory service.
|
Package contextstore provides the storage components for the context data used by the ProjectMemory service. |
|
errortypes
Package errortypes provides error types and handling for ProjectMemory.
|
Package errortypes provides error types and handling for ProjectMemory. |
|
server
Package server provides the MCP server implementation for the ProjectMemory service.
|
Package server provides the MCP server implementation for the ProjectMemory service. |
|
summarizer
Package summarizer provides interfaces and implementations for summarizing text content within the ProjectMemory service.
|
Package summarizer provides interfaces and implementations for summarizing text content within the ProjectMemory service. |
|
summarizer/providers
Package providers contains implementations of different LLM providers for text summarization.
|
Package providers contains implementations of different LLM providers for text summarization. |
|
telemetry
Package telemetry provides metrics collection and reporting for monitoring the LLM-Memory service performance.
|
Package telemetry provides metrics collection and reporting for monitoring the LLM-Memory service performance. |
|
tools
Package tools defines the interfaces and data structures for the ProjectMemory service.
|
Package tools defines the interfaces and data structures for the ProjectMemory service. |
|
vector
Package vector provides vector embedding utilities and text embedding within the ProjectMemory service.
|
Package vector provides vector embedding utilities and text embedding within the ProjectMemory service. |