Content Retrievers
Adding a retriever to your agent
@PeoplelogicAgent(value="thirdAgent",
name = "Third Agent", contentRetriever = "apmContentRetriever",
persona = "Funny but a bit snarky")
@PeoplelogicAgentInstructions("Your job is to say the current date.")
public interface ThirdAgent extends WorkerAgent {
@SystemMessage(BASE_WORKER_PROMPT)
Result<PeoplelogicResult> acceptWork(@MemoryId String userId, @UserMessage String query, @V("PreviousResponse") String agentResponse);
}Retrieval Augmentors and Query Routers
@Bean(value = "PeoplelogicKnowledgeRetrievalAugmentor")
public RetrievalAugmentor retrievalAugmentor() {
// Let's create a query router that will route each query to both retrievers.
// This does a quick lookup to verify that we need to use the RAG first
return PeoplelogicRetrievalAugmentor.builder()
.queryTransformer(ExpandingQueryTransformer.builder()
.chatModel(model).build())
.queryRouter(new DefaultQueryRouter(apmContentRetriever, trainingContentRetriever))
.build();
}Pre-built Components
Bean
Type
Description
Building your own Content Retriever
NamespaceAwareContentRetriever
PeoplelogicClasspathContentRetriever
Last updated
Was this helpful?
