This repository is a tiny, dependency-free agent scaffold.
context_manager/manager.go: in-memory conversation context.agent/base_agent.go: core loop (Model,Tool,ToolCall).agent/agent.go: lightweight constructors and function tool helper.agent/session_chat_conversations.go: minimal session wrapper andEchoModeldemo.
package main
import (
"context"
"fmt"
"time"
"pkg/agent"
)
func main() {
a := agent.New(
agent.EchoModel{},
"You are a concise assistant.",
agent.NewFuncTool("time_now", func(ctx context.Context, _ string) (string, error) {
return time.Now().Format(time.RFC3339), nil
}),
)
s := agent.NewSession("demo-session", a)
reply, err := s.Chat(context.Background(), "/time")
if err != nil {
panic(err)
}
fmt.Println(reply)
}go test ./...