feat: support separate knowledge bases for each agent

Also allow to export/import KB

Signed-off-by: mudler <mudler@localai.io>
This commit is contained in:
mudler
2024-12-18 20:17:05 +01:00
parent c68ff23b01
commit 8c447a0cf8
13 changed files with 205 additions and 99 deletions

View File

@@ -45,6 +45,7 @@ type RAGDB interface {
Store(s string) error
Reset() error
Search(s string, similarEntries int) ([]string, error)
Count() int
}
func New(opts ...Option) (*Agent, error) {
@@ -235,6 +236,10 @@ func (a *Agent) Paused() bool {
return a.pause
}
func (a *Agent) Memory() RAGDB {
return a.options.ragdb
}
func (a *Agent) runAction(chosenAction Action, params action.ActionParams) (result string, err error) {
for _, action := range a.systemInternalActions() {
if action.Definition().Name == chosenAction.Definition().Name {