bluememo

Quickstart

This runs on a laptop with Ollama and two small models.

This runs on a laptop with Ollama and two small models:

ollama pull qwen3.5:4b
ollama pull embeddinggemma
go get github.com/yeomyeonggeori/bluememo

Alex tells the agent three things once. Later the agent has to write to Alex and asks the store how:

package main

import (
	"context"
	"fmt"
	"log"

	"github.com/yeomyeonggeori/bluememo"
	"github.com/yeomyeonggeori/bluememo/ollama"
)

func main() {
	ctx := context.Background()
	model := ollama.New("qwen3.5:4b", "embeddinggemma")

	store, errorValue := bluememo.Open(ctx, "alex.db", bluememo.Configuration{
		Embedder:       model,
		EmbeddingModel: model.EmbeddingModel,
		Model:          model,
		Judge:          bluememo.DistributionJudge{Chooser: model},
	})
	if errorValue != nil {
		log.Fatal(errorValue)
	}
	defer store.Close()

	store.Memorize(ctx, bluememo.Note{
		SpeakerName: "Alex",
		Body:        "I lead the payments team. Send me meeting notes in Markdown, and I'm off every Friday this month.",
	})
	if _, errorValue := store.Settle(ctx); errorValue != nil {
		log.Fatal(errorValue)
	}

	result, errorValue := store.Recall(ctx, "How should I send Alex the notes from today's meeting?", 3)
	if errorValue != nil {
		log.Fatal(errorValue)
	}
	for _, recalled := range result.Memories {
		fmt.Println(recalled.Memory.Content)
	}
}
Alex wants meeting notes in Markdown.
Alex leads the payments team.
Alex is off every Friday this month.

The one message became three sentences that each stand on their own, and the one about notes answers first. Alex leads the payments team. is stored as a permanent trait, so store.Profile(ctx) returns it for every conversation, and the Friday sentence expires on the first of next month without anyone deleting it.

The same program is in examples/quickstart. ollama is a small adapter for local models; a host with its own model client implements the three ports instead.