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-agentThe wizard guides you through:
- Installing required packages (e.g., agentica@0.12.14)
- 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({
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>(),
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-keyUse 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! π