Building an agentic career alter ego

Building an agentic career alter ego


New
Agentic AI RAG

Introduction

With Agentic AI rapidly transforming every industry, I felt it was the right time to dive deeper into this emerging paradigm. To get hands-on experience, I enrolled in The Complete Agentic AI Engineering Course (2025) by Ed Donner and the Ligency Team on Udemy. Among the many compelling projects covered in the course, one in particular caught my attention: building a career-focused conversational agent.

The idea behind this agent is simple but powerful — an assistant-like interface that can respond to questions about your career, skills, and resume. It’s easy to imagine such a tool becoming a standard feature in future professional profiles — a sort of “living CV.”

In this post, I’ll walk you through how I extended the course project to create a smarter version of the agent by integrating Retrieval-Augmented Generation (RAG). But rather than using RAG in the traditional sense — where every query triggers a document retrieval — I designed the agent to decide when to use RAG. This allows it to minimize unnecessary API calls and keep prompts lightweight, only leveraging publication data when it’s truly needed. This design decision aligns more closely with the agentic philosophy: giving the AI the autonomy to choose the right tools for the task.

I called this project ProFile AI — short for Professional Profile AI — a smart assistant designed to be the CV of the future.

Architecture

The core of the application is built around an agentic architecture, giving the agent — powered by OpenAI’s GPT-4o-mini — the autonomy to decide when and which tools to use, or whether to rely solely on its internal reasoning and the information provided with the system prompt. This dynamic behavior allows the agent to respond more intelligently based on the context of each interaction.

The agent has access to three key tools:

  • ❓ Record Unknown Answer
    If the agent is asked a question it can’t answer based on the available professional data, it triggers this tool to log the event via Pushover’s API — sending a real-time notification so that gaps in knowledge can be identified and addressed.

  • 📧 Notify Contact Request
    When a user asks to be contacted or wants more information via email, this tool sends a notification with their name and email through Pushover, ensuring prompt follow-up.

  • 📚 Publication RAG
    This tool leverages ChromaDB and OpenAI Embeddings to search and retrieve relevant information from stored publications. The retrieved content is then added to the agent’s prompt as extra context — but only when the agent determines it’s necessary, keeping interactions efficient and focused.

Description

📚 Retrieval-Augmented Generation (RAG) Tool

As mentioned earlier, the Publication RAG tool builds on top of Chroma — an open-source vector database optimized for storing and retrieving document embeddings — to pull in relevant content from academic publications based on user queries. Since publication formats vary greatly depending on the type and publisher, extracting structured information and metadata can be particularly challenging.

To improve retrieval quality, each document is enriched with metadata. In this project, every chunk of content includes:

  • 📝 Document title
  • 📄 Page number
  • 🔖 Section title

This metadata allows the agent to perform both document-level and section-level retrieval, resulting in more accurate and relevant answers.


🧠 Detecting Section Titles with Visual Heuristics

One of the more complex aspects was detecting section titles. Because publication layouts vary widely, a single fixed rule doesn’t suffice. To address this, I designed a layout-aware heuristic based on font size and weight.

Using the Python library PyMuPDF, span-level formatting details were extracted as follows:

blocks = page.get_text("dict")["blocks"]
spans_info = []

for block in blocks:
    for line in block.get("lines", []):
        for span in line.get("spans", []):
            spans_info.append({
                "text": span["text"].strip(),
                "size": span["size"],
                "font": span["font"],
                "bold": "Bold" in span["font"],
                "origin": span["origin"],
                "bbox": span["bbox"]
            })

Next, I computed the average font size of relevant spans to use as a baseline for comparison:

# Calculate average font size for the page
font_sizes = [s["size"] for s in spans_info if len(s["text"]) > 5]
avg_font_size = sum(font_sizes) / len(font_sizes) if font_sizes else 10

Finally, section headers were detected using a threshold-based approach. After testing on various layouts, a section_font_threshold value of 1.5× the average font size yielded the most consistent results:

is_potential_header = (
    span["size"] > avg_font_size * section_font_threshold
    or span["bold"]
    or text.isupper()
)
if is_potential_header and len(text) < 80:
    current_section = text.lower()

This lightweight heuristic proved effective across a wide range of document formats, significantly improving the relevance and structure of information returned by the RAG system.

🚀 Next Steps

While this initial version of the agent delivers solid results, there’s plenty of room for refinement — especially in how the knowledge base is constructed and queried. As the project evolves, here are a few directions I’m planning to explore:

  • Answer Caching
    Save frequently asked questions and their responses to reduce latency and API calls.

  • 🔍 Enhanced Retrieval with Smarter RAG
    Improvements aimed at making the agent even more context-aware and efficient:

    • 🧠 Introduce semantic memory to retain and recall key concepts over time.
    • 🔗 Implement hybrid search combining keyword and semantic similarity.
    • 🥇 Add result reranking for more relevant top answers.
    • 🧼 Apply metadata-based filtering to narrow down noisy results.
    • ✂️ Experiment with chunking strategies for better context windows.
    • 🖼️ Enable parsing and retrieval of images and tables within documents.

🤝 Contribute to the Project

Have ideas or want to build on top of this? I’d love your help!

Feel free to open a PR with your changes or additions — check out the GitHub repo linked in the next section.

  • The code for the ProFile AI project is available in the following GitHub Repo.
  • The original course project can be found at this link.
© 2025 Giuseppe Sirigu