Introduction
- playgroundโ You can see the demo code on the playground.
Set up a fully functional Arxiv Search Agent powered by OpenAIโs GPT model quickly using the Agentica CLI.
Quick CLI Setup
Launch the Agentica Setup Wizard with a single command:
npx agentica start arxiv-search-agent
The wizard guides you through:
- Installing required packages (e.g., [email protected])
- Choosing your package manager and project type
- Selecting the ARXIV SEARCH controller
- Entering your
OPENAI_API_KEY
Once complete, Agentica automatically generates your code, creates a .env
file, and installs all dependencies.
Generated Code Overview
The generated code looks like this:
import { Agentica } from "@agentica/core";
import typia from "typia";
import dotenv from "dotenv";
import { OpenAI } from "openai";
import { ArxivSearchService } from "@wrtnlabs/connector-arxiv-search";
dotenv.config();
export const agent = new Agentica({
model: "chatgpt",
vendor: {
api: new OpenAI({
apiKey: process.env.OPENAI_API_KEY!,
}),
model: "gpt-4o-mini",
},
controllers: [
{
name: "ArxivSearch Connector",
protocol: "class",
application: typia.llm.application<ArxivSearchService, "chatgpt">(),
execute: new ArxivSearchService(),
},
],
});
const main = async () => {
console.log(await agent.conversate("What can you do?"));
};
main();
This code instantly sets up your Arxiv Search Agent, ready to intelligently search research papers.
What This Does
Your Arxiv Search Agent will:
- Process Arxiv Search Data: Interact with the Arxiv Search API using the
ArxivSearchService
. - Leverage OpenAIโs GPT Model: For smart, AI-powered paper searches.
- Ensure Type Safety: Using
typia
. - Securely Manage Credentials: With environment variables.
Set up your environment variable in a .env
file:
OPENAI_API_KEY=your-openai-api-key
Use Case Example
Imagine asking the agent:
โFind papers related to AI Agent.โ
The agent will search Arxiv for relevant research papers based on your criteria.
Available Functions
For a complete list of available functions in ArxivSearchService
, check out the source code:
๐ wrtnlabs/connectors - ArxivSearchService.tsโ
Your AI-powered Arxiv Search Agent is now ready to explore research papers seamlessly! ๐