MCPcopy Create free account
hub / github.com/docker/docker-agent / Start

Method Start

pkg/tools/builtin/rag/rag.go:81–101  ·  view source on GitHub ↗

Start initializes the RAG manager (indexes documents) and starts a file watcher for incremental updates.

(ctx context.Context)

Source from the content-addressed store, hash-verified

79// Start initializes the RAG manager (indexes documents) and starts a
80// file watcher for incremental updates.
81func (t *ToolSet) Start(ctx context.Context) error {
82 if t.manager == nil {
83 return nil
84 }
85
86 // Forward RAG manager events if a callback is set.
87 if t.eventCallback != nil {
88 go t.forwardEvents(ctx)
89 }
90
91 if err := t.manager.Initialize(ctx); err != nil {
92 return fmt.Errorf("failed to initialize RAG manager %q: %w", t.toolName, err)
93 }
94
95 go func() {
96 if err := t.manager.StartFileWatcher(ctx); err != nil {
97 slog.ErrorContext(ctx, "Failed to start RAG file watcher", "tool", t.toolName, "error", err)
98 }
99 }()
100 return nil
101}
102
103// Stop closes the RAG manager and releases resources.
104func (t *ToolSet) Stop(_ context.Context) error {

Callers

nothing calls this directly

Implementers 15

StartableToolSetpkg/tools/startable.go
fakeToolSetpkg/tools/named_test.go
stubDescriberpkg/tools/startable_test.go
stubToolSetpkg/tools/startable_test.go
flappyToolSetpkg/tools/startable_test.go
listFlappyToolSetpkg/tools/startable_test.go
reportingToolSetpkg/tools/startable_test.go
reportingStartOnlyToolSetpkg/tools/startable_test.go
recoveryFailingToolSetpkg/tools/startable_test.go
codeModeToolpkg/tools/codemode/codemode.go
testToolSetpkg/tools/codemode/codemode_test.go
Toolsetpkg/tools/a2a/a2a.go

Calls 3

forwardEventsMethod · 0.95
InitializeMethod · 0.65
StartFileWatcherMethod · 0.65

Tested by

no test coverage detected