Add an index

This commit is contained in:
mudler
2024-04-10 19:40:39 +02:00
parent 7c70f09834
commit 82ac74ac5d
7 changed files with 111 additions and 77 deletions

View File

@@ -176,6 +176,8 @@ func (a *Agent) consumeJob(job *Job, role string) {
// We are self evaluating if we consume the job as a system role
selfEvaluation := role == SystemRole
memory := a.options.enableKB && a.options.ragdb != nil
a.Lock()
// Set the action context
ctx, cancel := context.WithCancel(context.Background())
@@ -206,7 +208,7 @@ func (a *Agent) consumeJob(job *Job, role string) {
}
// RAG
if a.options.enableKB && a.options.ragdb != nil {
if memory {
// Walk conversation from bottom to top, and find the first message of the user
// to use it as a query to the KB
var userMessage string