Check my levelCoursesProgramsFor teamsPricing
UKSign inSign up
Check my levelCoursesProgramsFor teamsPricingClaude quizPromptsBlogFAQSearchSign upUK
AcademlCoursesOpenAI Cookbook: Based on OpenAI MaterialsFunction Calling for Knowledge Retrieval
A maths tutor solves 3x + 11 = 14 step by stepA workflow map: a Telegram message branches into command, voice and text and reaches the agentA form request lands in a spreadsheet row labelled “Complaint”
Course

OpenAI Cookbook: Based on OpenAI Materials

Module 1 · Assistants API and Agents
01Stateful Assistants on the Responses API
Module 2 · Function Calling and Retrieval
02Function Calling for Knowledge Retrieval
Module 3 · Embeddings and Search
03Embedding Wikipedia Articles for Semantic Search
Module 4 · Prompting and Optimization
04Meta-Prompting: Automated Prompt Optimization
Module 5 · Vision and Multimodality
05GPT Vision for Video Understanding
Module 6 · Reliability and Quality
06Hallucination Guardrails for Support Agents
Module 7 · Data Extraction and Transformation
07Data Extraction from PDFs: GPT as OCR
Module 8 · Fine-Tuning
08Accurate Function Calling Without Fine-Tuning
OpenAI Cookbook: Based on OpenAI Materials · Lesson 2

Function Calling for Knowledge Retrieval

Build an agent with two functions on the Responses API: arXiv paper search with embeddings and PDF summarization. The agent decides which function to call; covers strict mode, multiple calls per turn and the built-in file_search and web_search tools.

25 min readUpdated Dec 2, 20263 questions in quizReady prompt included

Agent Architecture

In this example the agent has access to two functions:

  • get_articles — searches arXiv for papers, downloads PDFs, computes embeddings
  • read_article_and_summarize — reads a PDF from the local library and summarizes it

The example comes from an OpenAI Cookbook recipe that is now marked as archived: it uses older models and Chat Completions. Below is the same agent on the Responses API, which OpenAI recommends for new projects. gpt-6-luna is inexpensive and fits this kind of loop. The recipe's gpt-4o-mini is deprecated and shuts down on January 14, 2027, and OpenAI names gpt-6-luna as its replacement.

The rest of this lesson opens after a free sign-up

Sign up with email or Google: the first two lessons of every course stay open for good, and the whole catalog is open for 7 days. No card needed.

Sign up freeOr a trial lesson, no sign-up →
In this lesson
Agent ArchitectureDefining FunctionsRanking by Cosine SimilarityAgent LoopBuilt-in Tools Instead of Hand-Rolled SearchPracticeReady promptQuiz
CoursesLLM coursesFor teamsPricingFAQBlogAboutPrivacy
© 2026 AcademlDevelopment & promotion —MMIX — Marketing Mix
Get started free