bench

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConvoMemCategories = map[string]string{
	"user_evidence":                "User Facts",
	"assistant_facts_evidence":     "Assistant Facts",
	"changing_evidence":            "Changing Facts",
	"abstention_evidence":          "Abstention",
	"preference_evidence":          "Preferences",
	"implicit_connection_evidence": "Implicit Connections",
}

Functions

func FormatConvoMem

func FormatConvoMem(result ConvoMemResult) string

func FormatLoCoMo

func FormatLoCoMo(result LoCoMoResult) string

func FormatLongMemEval

func FormatLongMemEval(result LongMemEvalResult) string

func FormatMemBench

func FormatMemBench(result MemBenchResult) string

func FormatPerf

func FormatPerf(result PerfResult) string

func WriteConvoMemResult

func WriteConvoMemResult(path string, result ConvoMemResult) error

func WriteLoCoMoResult

func WriteLoCoMoResult(path string, result LoCoMoResult) error

func WriteLongMemEvalResult

func WriteLongMemEvalResult(path string, result LongMemEvalResult) error

func WriteMemBenchResult

func WriteMemBenchResult(path string, result MemBenchResult) error

func WritePerfResult

func WritePerfResult(path string, result PerfResult) error

Types

type ConvoMemConversation

type ConvoMemConversation struct {
	Messages []ConvoMemMessage `json:"messages"`
}

type ConvoMemEvidenceFile

type ConvoMemEvidenceFile struct {
	EvidenceItems []ConvoMemItem `json:"evidence_items"`
}

type ConvoMemItem

type ConvoMemItem struct {
	Question         string                    `json:"question"`
	Answer           string                    `json:"answer"`
	Conversations    []ConvoMemConversation    `json:"conversations"`
	MessageEvidences []ConvoMemMessageEvidence `json:"message_evidences"`
	CategoryKey      string                    `json:"-"`
}

type ConvoMemItemResult

type ConvoMemItemResult struct {
	Question       string  `json:"question"`
	Category       string  `json:"category"`
	Recall         float64 `json:"recall"`
	RetrievedCount int     `json:"retrieved_count"`
	EvidenceCount  int     `json:"evidence_count"`
	Found          int     `json:"found"`
}

type ConvoMemMessage

type ConvoMemMessage struct {
	Speaker string `json:"speaker"`
	Text    string `json:"text"`
}

type ConvoMemMessageEvidence

type ConvoMemMessageEvidence struct {
	Text string `json:"text"`
}

type ConvoMemResult

type ConvoMemResult struct {
	Items          int                  `json:"items"`
	AverageRecall  float64              `json:"average_recall"`
	ElapsedSeconds float64              `json:"elapsed_seconds"`
	PerCategory    map[string]float64   `json:"per_category"`
	Distribution   map[string]int       `json:"distribution"`
	Results        []ConvoMemItemResult `json:"results,omitempty"`
}

func RunConvoMem

func RunConvoMem(ctx context.Context, categories []string, limitPerCategory, topK int, cacheDir string, provider vector.Provider) (ConvoMemResult, error)

type LatencyStats

type LatencyStats struct {
	Count int     `json:"count"`
	AvgMs float64 `json:"avg_ms"`
	P50Ms float64 `json:"p50_ms"`
	P95Ms float64 `json:"p95_ms"`
	P99Ms float64 `json:"p99_ms"`
	MinMs float64 `json:"min_ms"`
	MaxMs float64 `json:"max_ms"`
}

type LoCoMoDialog

type LoCoMoDialog struct {
	DiaID   string `json:"dia_id"`
	Speaker string `json:"speaker"`
	Text    string `json:"text"`
}

type LoCoMoItemResult

type LoCoMoItemResult struct {
	Question  string   `json:"question"`
	Category  int      `json:"category"`
	Evidence  []string `json:"evidence"`
	Retrieved []string `json:"retrieved"`
	Recall    float64  `json:"recall"`
}

type LoCoMoQA

type LoCoMoQA struct {
	Question string   `json:"question"`
	Category int      `json:"category"`
	Evidence []string `json:"evidence"`
}

type LoCoMoResult

type LoCoMoResult struct {
	Questions      int                `json:"questions"`
	AverageRecall  float64            `json:"average_recall"`
	ElapsedSeconds float64            `json:"elapsed_seconds"`
	PerCategory    map[int]float64    `json:"per_category"`
	Distribution   map[string]int     `json:"distribution"`
	Results        []LoCoMoItemResult `json:"results,omitempty"`
}

func RunLoCoMo

func RunLoCoMo(ctx context.Context, dataFile string, limit int, topK int, provider vector.Provider) (LoCoMoResult, error)

type LongMemEvalEntry

type LongMemEvalEntry struct {
	Question           string   `json:"question"`
	QuestionType       string   `json:"question_type"`
	QuestionDateRaw    string   `json:"question_date"`
	AnswerSessionIDs   []string `json:"answer_session_ids"`
	HaystackSessions   [][]Turn `json:"haystack_sessions"`
	HaystackSessionIDs []string `json:"haystack_session_ids"`
	HaystackDates      []string `json:"haystack_dates"`
}

func (LongMemEvalEntry) QuestionDate

func (e LongMemEvalEntry) QuestionDate() string

type LongMemEvalItemResult

type LongMemEvalItemResult struct {
	Question          string   `json:"question"`
	QuestionType      string   `json:"question_type"`
	CorrectSessionIDs []string `json:"correct_session_ids"`
	TopResults        []string `json:"top_results"`
	RecallAt1         float64  `json:"recall_at_1"`
	RecallAt5         float64  `json:"recall_at_5"`
	RecallAt10        float64  `json:"recall_at_10"`
	ReciprocalRank    float64  `json:"reciprocal_rank"`
	NDCGAt10          float64  `json:"ndcg_at_10"`
}

type LongMemEvalResult

type LongMemEvalResult struct {
	Questions       int                     `json:"questions"`
	RecallAt1       float64                 `json:"recall_at_1"`
	RecallAt5       float64                 `json:"recall_at_5"`
	RecallAt10      float64                 `json:"recall_at_10"`
	MRR             float64                 `json:"mrr"`
	NDCGAt10        float64                 `json:"ndcg_at_10"`
	ElapsedSeconds  float64                 `json:"elapsed_seconds"`
	PerQuestionType map[string]float64      `json:"per_question_type"`
	Distribution    map[string]int          `json:"distribution"`
	Items           []LongMemEvalItemResult `json:"items,omitempty"`
}

func RunLongMemEval

func RunLongMemEval(ctx context.Context, dataFile string, limit int, provider vector.Provider) (LongMemEvalResult, error)

type MemBenchItem

type MemBenchItem struct {
	Category      string          `json:"category"`
	Topic         string          `json:"topic"`
	TID           int             `json:"tid"`
	Turns         interface{}     `json:"turns"`
	Question      string          `json:"question"`
	GroundTruth   string          `json:"ground_truth"`
	AnswerText    string          `json:"answer_text"`
	TargetStepIDs [][]interface{} `json:"target_step_ids"`
}

type MemBenchItemResult

type MemBenchItemResult struct {
	Category       string `json:"category"`
	Topic          string `json:"topic"`
	Question       string `json:"question"`
	GroundTruth    string `json:"ground_truth"`
	TargetSteps    []int  `json:"target_steps"`
	RetrievedSteps []int  `json:"retrieved_steps"`
	HitAtK         bool   `json:"hit_at_k"`
}

type MemBenchResult

type MemBenchResult struct {
	Items          int                  `json:"items"`
	RecallAtK      float64              `json:"recall_at_k"`
	TopK           int                  `json:"top_k"`
	ElapsedSeconds float64              `json:"elapsed_seconds"`
	PerCategory    map[string]float64   `json:"per_category"`
	Results        []MemBenchItemResult `json:"results,omitempty"`
}

func RunMemBench

func RunMemBench(ctx context.Context, dataDir string, categories []string, topic string, topK, limit int, provider vector.Provider) (MemBenchResult, error)

type PerfResult

type PerfResult struct {
	Entries                int          `json:"entries"`
	Searches               int          `json:"searches"`
	StoreSizeBytes         int64        `json:"store_size_bytes"`
	IndexSizeBytes         int64        `json:"index_size_bytes"`
	InitMs                 float64      `json:"init_ms"`
	AddLatency             LatencyStats `json:"add_latency"`
	SearchLatency          LatencyStats `json:"search_latency"`
	AddThroughputPerSec    float64      `json:"add_throughput_per_sec"`
	SearchThroughputPerSec float64      `json:"search_throughput_per_sec"`
}

func RunPerf

func RunPerf(root string, entries, searches int, provider vector.Provider) (PerfResult, error)

type Turn

type Turn struct {
	Role    string `json:"role"`
	Content string `json:"content"`
}

Jump to

Keyboard shortcuts

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