Versions in this module Expand all Collapse all v0 v0.0.1 Jul 10, 2026 v0.0.0 Jul 10, 2026 Changes in this version + const AssistantRole + const SystemRole + const UserRole + var CanStopItself = func(o *options) error + var DisableSinkState = func(o *options) error + var EnableAutoCompaction = func(o *options) error + var EnableForceReasoning = func(o *options) error + var EnableForceReasoningTool = func(o *options) error + var EnableGuidedTools = func(o *options) error + var EnableHUD = func(o *options) error + var EnableInitiateConversations = func(o *options) error + var EnableKnowledgeBase = func(o *options) error + var EnableLongTermMemory = func(o *options) error + var EnablePersonality = func(o *options) error + var EnablePlanning = func(o *options) error + var EnableStandaloneJob = func(o *options) error + var EnableStripThinkingTags = func(o *options) error + var EnableSummaryMemory = func(o *options) error + var ErrContextCanceled = fmt.Errorf("context canceled") + var WithPlanReviewerLLM = func(model string) Option + func NewKBWrapperActions(ragdb RAGDB, kbResults int) (*SearchKnowledgeBaseAction, *AddToKnowledgeBaseAction) + type AddToKnowledgeBaseAction struct + func (a *AddToKnowledgeBaseAction) Definition() types.ActionDefinition + func (a *AddToKnowledgeBaseAction) Run(ctx context.Context, sharedState *types.AgentSharedState, ...) (types.ActionResult, error) + type Agent struct + Character Character + func New(opts ...Option) (*Agent, error) + func (a *Agent) AddSubscriber(f func(*types.ConversationMessage)) + func (a *Agent) Ask(opts ...types.JobOption) *types.JobResult + func (a *Agent) AskDirect(opts ...types.JobOption) *types.JobResult + func (a *Agent) AskDirectSystem(opts ...types.JobOption) *types.JobResult + func (a *Agent) Context() context.Context + func (a *Agent) Enqueue(j *types.Job) + func (a *Agent) Execute(j *types.Job) *types.JobResult + func (a *Agent) LoadCharacter(path string) error + func (a *Agent) LoadState(path string) error + func (a *Agent) Memory() RAGDB + func (a *Agent) Observer() Observer + func (a *Agent) Pause() + func (a *Agent) Paused() bool + func (a *Agent) Resume() + func (a *Agent) Run() error + func (a *Agent) SaveCharacter(path string) error + func (a *Agent) SaveState(path string) error + func (a *Agent) SetStreamCallback(fn func(cogito.StreamEvent)) + func (a *Agent) SharedState() *types.AgentSharedState + func (a *Agent) StartConversationConsumer() + func (a *Agent) State() types.AgentInternalState + func (a *Agent) Stop() + func (a *Agent) TTS(ctx context.Context, text string) ([]byte, error) + func (a *Agent) Transcribe(ctx context.Context, file string) (string, error) + type Character struct + Age string + Hobbies []string + MusicTaste []string + Name string + Occupation string + Sex string + func Load(path string) (*Character, error) + func (c *Character) String() string + func (c *Character) ToJSONSchema() jsonschema.Definition + type CommonTemplateData struct + AgentName string + type ConversationStorageMode string + const StoreUserAndAssistant + const StoreUserOnly + const StoreWholeConversation + type DynamicPrompt interface + Render func(a *Agent) (types.PromptResult, error) + Role func() string + type InnerMonologueTemplateData struct + Task string + type KBWrapperActions struct + type MCPSTDIOServer struct + Args []string + Cmd string + Env []string + Name string + type MCPServer struct + Token string + URL string + type Messages []openai.ChatCompletionMessage + func (m Messages) Exist(content string) bool + func (m Messages) GetLatestUserMessage() *openai.ChatCompletionMessage + func (m Messages) RemoveIf(f func(msg openai.ChatCompletionMessage) bool) Messages + func (m Messages) RemoveLastUserMessage() Messages + func (m Messages) Save(path string) error + func (m Messages) String() string + func (m Messages) ToOpenAI() []openai.ChatCompletionMessage + type NoToolToCallArgs struct + Reasoning string + type NoToolToCallTool struct + func (t NoToolToCallTool) Run(args NoToolToCallArgs) (string, any, error) + type Observer interface + ClearHistory func() + History func() []types.Observable + NewObservable func() *types.Observable + Update func(types.Observable) + type Option func(*options) error + func EnableEvaluation() Option + func EnableKnowledgeBaseWithResults(results int) Option + func FromFile(path string) Option + func WithActions(actions ...types.Action) Option + func WithAgentReasoningCallback(cb func(types.ActionCurrentState) bool) Option + func WithAgentResultCallback(cb func(types.ActionState)) Option + func WithAutoCompactionThreshold(threshold int) Option + func WithCancelPreviousOnNewMessage(cancel bool) Option + func WithCharacter(c Character) Option + func WithCharacterFile(path string) Option + func WithContext(ctx context.Context) Option + func WithConversationStorageMode(mode ConversationStorageMode) Option + func WithConversationsPath(path string) Option + func WithInnerMonologueTemplate(template string) Option + func WithJobFilters(filters ...types.JobFilter) Option + func WithKBAutoSearch(enabled bool) Option + func WithLLMAPIKey(key string) Option + func WithLLMAPIURL(url string) Option + func WithLastMessageDuration(duration string) Option + func WithLoopDetection(loops int) Option + func WithMCPPrepareScript(script string) Option + func WithMCPSTDIOServers(servers ...MCPSTDIOServer) Option + func WithMCPServers(servers ...MCPServer) Option + func WithMCPSession(session *mcp.ClientSession) Option + func WithMaxAttempts(attempts int) Option + func WithMaxEvaluationLoops(loops int) Option + func WithModel(model string) Option + func WithMultimodalModel(model string) Option + func WithNewConversationSubscriber(sub func(*types.ConversationMessage)) Option + func WithObserver(observer Observer) Option + func WithParallelJobs(jobs int) Option + func WithPeriodicRuns(duration string) Option + func WithPermanentGoal(goal string) Option + func WithPrompts(prompts ...DynamicPrompt) Option + func WithRAGDB(db RAGDB) Option + func WithRandomIdentity(guidance ...string) Option + func WithSchedulerPollInterval(duration string) Option + func WithSchedulerStorePath(path string) Option + func WithSchedulerTaskTemplate(template string) Option + func WithSkillPromptTemplate(template string) Option + func WithStateFile(path string) Option + func WithStreamCallback(fn func(cogito.StreamEvent)) Option + func WithSystemPrompt(prompt string) Option + func WithTTSModel(model string) Option + func WithTimeout(timeout string) Option + func WithTranscriptionLanguage(language string) Option + func WithTranscriptionModel(model string) Option + type PromptHUD struct + Character Character + CurrentState types.AgentInternalState + PermanentGoal string + ShowCharacter bool + type RAGDB interface + Count func() int + Reset func() error + Search func(s string, similarEntries int) ([]string, error) + Store func(s string) error + type SSEObserver struct + func NewSSEObserver(agent string, manager sse.Manager) *SSEObserver + func (s *SSEObserver) ClearHistory() + func (s *SSEObserver) History() []types.Observable + func (s *SSEObserver) NewObservable() *types.Observable + func (s *SSEObserver) Update(obs types.Observable) + type SearchKnowledgeBaseAction struct + func (a *SearchKnowledgeBaseAction) Definition() types.ActionDefinition + func (a *SearchKnowledgeBaseAction) Run(ctx context.Context, sharedState *types.AgentSharedState, ...) (types.ActionResult, error) + type ToolInputSchema struct + Properties map[string]interface{} + Required []string + Type string