research

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2025 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package deepresearch is a port of atomic-agents/deepresearch to secai. https://github.com/BrainBlend-AI/atomic-agents/blob/main/atomic-examples/deep-research/deep_research/main.py

Index

Constants

View Source
const APrefix = "cook"

Variables

View Source
var PassAA = shared.Pass
View Source
var Sj = shared.Sj
View Source
var Sl = shared.Sl
View Source
var Sp = shared.Sp
View Source
var StarterQuestions = Sp(`
    1. Can you help me research the latest AI news?
    2. Who won the Nobel Prize in Physics this year?
    3. Where can I learn more about quantum computing?
`)
View Source
var WelcomeMessage = Sj(
	"Welcome to Deep Research - your AI-powered research assistant! I can help you explore and ",
	"understand any topic through detailed research and interactive discussion.",
)

Functions

func LogArgs

func LogArgs(args am.A) map[string]string

LogArgs is an args logger for A and secai.A.

func Pass

func Pass(args *A) am.A

Pass prepares am.A from A to be passed to further mutations (encoder).

func PassRpc

func PassRpc(args *A) am.A

PassRpc is a network-safe version of Pass. Use it when mutating aRPC workers.

Types

type A

type A struct {
	// base args of the framework
	*shared.A
}

A is a struct for node arguments. It's a typesafe alternative to am.A.

func ParseArgs

func ParseArgs(args am.A) *A

ParseArgs extracts A from am.Event.ArgsAPrefix (decoder).

type AA

type AA = shared.A

type AARpc

type AARpc = shared.ARpc

type ARpc

type ARpc struct {
	// base args of the framework
	*shared.A
}

ARpc is a subset of am.A, that can be passed over RPC (eg no channels, instances, etc)

type Agent

type Agent struct {
	// inherit from LLM Agent
	*llmagent.Agent

	Config Config
	TUIs   []shared.UI

	Msgs []*shared.Msg
	// contains filtered or unexported fields
}

func New

func New(
	ctx context.Context, id string, states am.S, machSchema am.Schema,
) *Agent

New returns a custom instance of Agent.

func NewResearch

func NewResearch(ctx context.Context, config Config) (*Agent, error)

NewResearch returns a preconfigured instance of Agent.

func (*Agent) AnsweredEnter

func (a *Agent) AnsweredEnter(e *am.Event) bool

func (*Agent) AnsweredState

func (a *Agent) AnsweredState(e *am.Event)

func (*Agent) AnsweringState

func (a *Agent) AnsweringState(e *am.Event)

func (*Agent) CheckingInfoState

func (a *Agent) CheckingInfoState(e *am.Event)

func (*Agent) DisposedState

func (a *Agent) DisposedState(e *am.Event)

func (*Agent) ExceptionState

func (a *Agent) ExceptionState(e *am.Event)

func (*Agent) Init

func (a *Agent) Init(agent secai.AgentAPI) error

func (*Agent) InputPendingState

func (a *Agent) InputPendingState(e *am.Event)

InputPendingState is a test mocking handler.

func (*Agent) InterruptedState

func (a *Agent) InterruptedState(e *am.Event)

func (*Agent) LoopState

func (a *Agent) LoopState(e *am.Event)

func (*Agent) ReadyEnter

func (a *Agent) ReadyEnter(e *am.Event) bool

func (*Agent) ScrapingState

func (a *Agent) ScrapingState(e *am.Event)

func (*Agent) SearchingLLMState

func (a *Agent) SearchingLLMState(e *am.Event)

func (*Agent) SearchingWebState

func (a *Agent) SearchingWebState(e *am.Event)

func (*Agent) StartState

func (a *Agent) StartState(e *am.Event)

func (*Agent) UIModeEnd

func (a *Agent) UIModeEnd(e *am.Event)

func (*Agent) UIModeState

func (a *Agent) UIModeState(e *am.Event)

func (*Agent) UIReadyEnter

func (a *Agent) UIReadyEnter(e *am.Event) bool

func (*Agent) UISessConnState

func (a *Agent) UISessConnState(e *am.Event)

func (*Agent) UISessDisconnState

func (a *Agent) UISessDisconnState(e *am.Event)

type Config

type Config struct {
	OpenAIAPIKey   string `arg:"env:OPENAI_API_KEY" help:"OpenAI API key."`
	DeepseekAPIKey string `arg:"env:DEEPSEEK_API_KEY" help:"DeepSeek API key."`
	TUIPort        int    `arg:"env:SECAI_TUI_PORT" help:"SSH port for the TUI." default:"7854"`
	TUIHost        string `arg:"env:SECAI_TUI_HOST" help:"SSH host for the TUI." default:"localhost"`
	Mock           bool   `arg:"env:SECAI_MOCK" help:"Enable scenario mocking."`
	ReqLimit       int    `arg:"env:SECAI_REQ_LIMIT" help:"Max LLM requests per session." default:"1000"`
}

type S

type S = am.S

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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