llamaIndex - ✅(Solved) Fix [Feature Request]: iGPT Email Intelligence Tool / Data Loader [1 pull requests, 6 comments, 4 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
run-llama/llama_index#20674Fetched 2026-04-08 00:31:35
View on GitHub
Comments
6
Participants
4
Timeline
19
Reactions
0
Author
Timeline (top)
commented ×6mentioned ×4subscribed ×4labeled ×3

Root Cause

Standard RAG approaches break on email because threads are conversational graphs, not flat documents. Chunking individual messages loses the relationships between replies, forwards, and CCs. Metadata (who said what, when, to whom) matters as much as body text, but gets stripped during typical ingestion.

Fix Action

Fixed

PR fix notes

PR #20727: feat: Add iGPT Email Intelligence tool and reader integrations

Description (problem / solution / changelog)

Description

Adds two new integration packages for the iGPT Email Intelligence API:

  • llama-index-tools-igpt-emailIGPTEmailToolSpec wraps recall.ask() and recall.search() so agents can query structured email context on demand
  • llama-index-readers-igpt-emailIGPTEmailReader wraps recall.search() to load email context as LlamaIndex Document objects for indexing and retrieval

Unlike existing email integrations (Gmail, IMAP) that return raw message data, iGPT handles thread reconstruction, participant role detection, temporal reasoning, and intent extraction before returning results. This means each Document already contains structured, reasoning-ready content — tasks, decisions, owners, deadlines, and citations — with full thread metadata preserved in metadata (subject, from, to, date, thread_id).

Dependency: igptai>=0.1.0 (pip install igptai)

Fixes #20674

New Package?

Did I fill in the tool.llamahub section in the pyproject.toml and provide a detailed README.md for my new integration or package?

  • Yes

Version Bump?

Did I bump the version in the pyproject.toml file of the package I am updating?

  • Yes (both packages start at 0.1.0)

Type of Change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • I added new unit tests to cover this change

Tool — 12 tests covering: base class inheritance, spec_functions declaration, __init__ with SDK mock, ask() with JSON response, ask() with text format, ask() with plain string response, search() with list response, search() with dict-wrapped response, search() with empty response, search() with None response, default parameter values, and ImportError on missing igptai package.

Reader — 9 tests covering: base class inheritance, load_data() with list response, load_data() with dict-wrapped response, body field fallback when content is absent, default max_results, empty response, None response, non-dict items, and ImportError on missing igptai package.

All 21 tests pass with zero warnings.

Suggested Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I ran uv run make format; uv run make lint to appease the lint gods

Changed files

  • llama-index-integrations/readers/llama-index-readers-igpt-email/README.md (added, +30/-0)
  • llama-index-integrations/readers/llama-index-readers-igpt-email/llama_index/readers/igpt_email/__init__.py (added, +3/-0)
  • llama-index-integrations/readers/llama-index-readers-igpt-email/llama_index/readers/igpt_email/base.py (added, +104/-0)
  • llama-index-integrations/readers/llama-index-readers-igpt-email/pyproject.toml (added, +70/-0)
  • llama-index-integrations/readers/llama-index-readers-igpt-email/tests/__init__.py (added, +0/-0)
  • llama-index-integrations/readers/llama-index-readers-igpt-email/tests/test_readers_igpt_email.py (added, +221/-0)
  • llama-index-integrations/tools/llama-index-tools-igpt-email/README.md (added, +35/-0)
  • llama-index-integrations/tools/llama-index-tools-igpt-email/llama_index/tools/igpt_email/__init__.py (added, +3/-0)
  • llama-index-integrations/tools/llama-index-tools-igpt-email/llama_index/tools/igpt_email/base.py (added, +155/-0)
  • llama-index-integrations/tools/llama-index-tools-igpt-email/pyproject.toml (added, +70/-0)
  • llama-index-integrations/tools/llama-index-tools-igpt-email/tests/__init__.py (added, +0/-0)
  • llama-index-integrations/tools/llama-index-tools-igpt-email/tests/test_tools_igpt_email.py (added, +268/-0)
RAW_BUFFERClick to expand / collapse

Feature Description

A tool and/or data loader integration for iGPT, an Email Intelligence API that returns structured, reasoning-ready context from email threads.

Unlike raw email connectors that return unprocessed message data, iGPT handles thread reconstruction, participant role detection, temporal reasoning, and intent extraction. The API returns structured JSON with tasks, owners, decisions, sentiment, deadlines, and citations.

Proposed integration — two possible components:

Tool** (iGPTEmailTool): Wraps recall.ask() and recall.search() endpoints. Agents can query email context and get structured responses in a single call. Data Loader** (iGPTReader): Wraps recall.search() to load email context as LlamaIndex Documents for indexing and retrieval.

API details: Base URL: https://api.igpt.ai/v1 Auth: Bearer token (API key) Key endpoints: recall/ask (reasoning + retrieval), recall/search (retrieval only) Output: Structured JSON with citations Python SDK: pip install igptai — GitHub Docs: https://docs.igpt.ai Github: https://github.com/orgs/igptai/

Reason

There is currently no LlamaIndex integration that handles email context engineering. The existing email-related tools and loaders connect to Gmail or IMAP and return raw message data, which leaves developers to handle thread reconstruction, deduplication, participant tracking, and context assembly themselves.

Standard RAG approaches break on email because threads are conversational graphs, not flat documents. Chunking individual messages loses the relationships between replies, forwards, and CCs. Metadata (who said what, when, to whom) matters as much as body text, but gets stripped during typical ingestion.

iGPT solves this preprocessing layer and returns structured, reasoning-ready JSON. A LlamaIndex integration would let developers skip months of email infrastructure work and go straight to building their application.

Value of Feature

Email is the most common business data source (376 billion messages sent daily) but one of the hardest to make useful for AI applications. Developers building RAG apps, AI agents, and workflow automation over email data currently have to build their own parsing, threading, and extraction infrastructure before they can even start on their actual product.

An iGPT integration would give LlamaIndex users a one-call path from raw inbox data to structured outputs (tasks, decisions, owners, sentiment, deadlines) with citations. This is useful for anyone building CRM auto-updates, customer health dashboards, deal risk monitors, support ticket automation, or any application that needs to reason over business communications.

The Python SDK already exists (pip install igptai), so the integration surface is straightforward.

extent analysis

Fix Plan

To integrate iGPT with LlamaIndex, we need to create two components: iGPTEmailTool and iGPTReader. Here are the steps:

iGPTEmailTool

  • Install the iGPT Python SDK: pip install igptai
  • Import the SDK and create a client instance with your API key
  • Implement a function to wrap the recall.ask() and recall.search() endpoints
  • Use the function to query email context and get structured responses

iGPTReader

  • Implement a function to wrap the recall.search() endpoint
  • Use the function to load email context as LlamaIndex Documents for indexing and retrieval

Example Code

import igptai

# Initialize the iGPT client
client = igptai.Client(api_key="YOUR_API_KEY")

# iGPTEmailTool function to query email context
def query_email_context(query):
    response = client.recall.ask(query)
    return response.json()

# iGPTReader function to load email context as LlamaIndex Documents
def load_email_context(query):
    response = client.recall.search(query)
    documents = []
    for result in response.json():
        document = {
            "id": result["id"],
            "text": result["text"],
            "metadata": result["metadata"]
        }
        documents.append(document)
    return documents

Verification

To verify the integration, you can test the query_email_context and load_email_context functions with sample queries. Check that the responses are in the expected format and contain the correct information.

Extra Tips

  • Make sure to replace YOUR_API_KEY with your actual iGPT API key.
  • You can customize the query_email_context and load_email_context functions to fit your specific use case.
  • Consider implementing error handling and logging to ensure that any issues with the integration are properly handled and debugged.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

llamaIndex - ✅(Solved) Fix [Feature Request]: iGPT Email Intelligence Tool / Data Loader [1 pull requests, 6 comments, 4 participants]