rag 1.0.0 copy "rag: ^1.0.0" to clipboard
rag: ^1.0.0 copied to clipboard

Retrieval Augmented Generation for Agentic

RAG #

Do rag ez

void main() async {
  RagAgent agent = RagAgent(
    user: "dan",
    llm: OpenAIConnector(apiKey: openaiKey).connect(ChatModel.openai4_1),
    chatProvider: MemoryChatProvider(
      messages: [
        // Initial system message
        Message.system(
          "You are a helpful assistant. You retrieve records about the patient 'Jane Doe' for caregivers. You will need to access data before you can answer the caregivers questions.",
        ),
      ],
    ),
    vectorSpace: PineconeVectorSpace(
      namespace: "<some namespace>",
      host: "https://name-xxx.pinecone.io",
      apiKey: pineconeKey,
    ),
  );

  await agent.addMessage(Message.user("What is the patients date of birth?"));
  AgentMessage answer = await agent.rag();

  /// Show output of model
  for (Message message in await agent.readMessages()) {
    print(
      "${message.runtimeType.toString().replaceAll("Message", "")}: ${message.content}",
    );
  }
}
0
likes
130
points
6
downloads

Publisher

verified publisherarcane.art

Weekly Downloads

Retrieval Augmented Generation for Agentic

Repository (GitHub)
View/report issues

Documentation

API reference

License

GPL-3.0 (license)

Dependencies

agentic, artifact, bpe, pineconedb

More

Packages that depend on rag