Documentation
¶
Overview ¶
NemesisBot - AI agent License: MIT Copyright (c) 2026 NemesisBot contributors
Index ¶
- type Config
- type Episode
- type Store
- func (s *Store) Cleanup(ctx context.Context, olderThan time.Duration) (int, error)
- func (s *Store) Close() error
- func (s *Store) DeleteSession(ctx context.Context, sessionKey string) error
- func (s *Store) EpisodeCount() int
- func (s *Store) GetRecent(ctx context.Context, sessionKey string, limit int) ([]*Episode, error)
- func (s *Store) GetSession(ctx context.Context, sessionKey string) ([]*Episode, error)
- func (s *Store) Search(ctx context.Context, query string, limit int) ([]*Episode, error)
- func (s *Store) SessionCount() int
- func (s *Store) StoreEpisode(ctx context.Context, episode *Episode) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
StoragePath string // root directory for JSONL files
MaxEpisodesPerSession int // default 100
RetentionDays int // default 90
}
Config holds episodic store configuration.
type Episode ¶
type Episode struct {
ID string `json:"id"`
SessionKey string `json:"session_key"`
Role string `json:"role"` // user, assistant, system
Content string `json:"content"`
Timestamp time.Time `json:"timestamp"`
Metadata map[string]string `json:"metadata,omitempty"`
Tags []string `json:"tags,omitempty"`
}
Episode represents a single conversation episode/experience.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store implements episodic memory backed by per-session JSONL files.
func NewStore ¶
NewStore creates a new episodic store, creates directories, and loads existing data.
func (*Store) Cleanup ¶
Cleanup removes episodes older than the specified duration and returns the count removed.
func (*Store) Close ¶
Close flushes pending writes (in-memory data is always persisted on StoreEpisode).
func (*Store) DeleteSession ¶
DeleteSession removes all episodes for a given session and deletes the JSONL file.
func (*Store) EpisodeCount ¶
EpisodeCount returns the total number of episodes across all sessions.
func (*Store) GetSession ¶
GetSession returns all episodes for a given session key.
func (*Store) SessionCount ¶
SessionCount returns the number of sessions stored.