Integrate Email Intelligence with LlamaIndex
LlamaIndex tool that connects agents to iGPT's email intelligence API, delivering structured context from email threads with thread reconstruction, participant
Why it matters
Connect your LlamaIndex agent to iGPT for structured email context. Gain reasoning-ready insights from email threads, including tasks, decisions, and sentiment.
Outcomes
What it gets done
Reconstruct email threads using iGPT.
Extract key information like tasks, decisions, and sentiment.
Search email context for relevant messages and threads.
Provide structured JSON output for agent consumption.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/li-tool-tools-igpt-email | bash Overview
LlamaIndex Tools Integration: iGPT Email Intelligence
This LlamaIndex tool integration connects agents to iGPT's email intelligence API. It provides two functions: ask (query email context with natural language) and search (find relevant messages and threads). iGPT preprocesses emails to deliver structured JSON with thread reconstruction, participant roles, temporal reasoning, intent extraction, tasks, decisions, sentiment, and deadlines. Use this when building LlamaIndex agents that need to answer questions about email conversations, extract action items, track decisions, or search historical email context. It fits scenarios where you want structured email intelligence without building your own NLP and thread-analysis pipeline.
What it does
LlamaIndex Tools Integration: iGPT Email Intelligence connects LlamaIndex agents to the iGPT API to provide structured, reasoning-ready context from connected email threads. Instead of raw message data, agents receive clean JSON with thread reconstruction, participant role detection, temporal reasoning, and intent extraction already handled by iGPT.
When to use - and when NOT to
Use this tool when building agents that need to answer questions about email context ("What tasks were assigned to me this week?"), search for relevant messages and threads, or extract structured information like tasks, decisions, owners, sentiment, deadlines, and citations from email conversations. It is designed specifically as a data-loading Tool in an Agent workflow.
Do NOT use this if you need direct IMAP/SMTP access or want to send emails - this tool is read-only and focused on intelligence extraction, not email composition or delivery.
Inputs and outputs
You provide an iGPT API key (obtained from docs.igpt.ai) and a user ID when initializing the tool spec. The tool exposes two functions:
ask: accepts a natural language question about email context and returns structured context including tasks, decisions, owners, sentiment, deadlines, and citationssearch: accepts search queries and returns matching email context as Documents with thread metadata (subject, participants, date, thread ID)
Both functions return structured JSON rather than raw email messages.
Integrations
This tool integrates with:
- iGPT (igpt.ai): the email intelligence API that performs thread reconstruction, participant analysis, and intent extraction
- LlamaIndex Core: uses
FunctionAgentand the tool spec pattern to expose email intelligence as agent-callable functions - LlamaIndex LLMs: works with LlamaIndex-compatible LLMs (example shows OpenAI)
### %pip install llama-index llama-index-core llama-index-tools-igpt-email
from llama_index.tools.igpt_email import IGPTEmailToolSpec
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI
tool_spec = IGPTEmailToolSpec(api_key="your-key", user="user-id")
agent = FunctionAgent(
tools=tool_spec.to_tool_list(),
llm=OpenAI(model="gpt-4.1"),
)
print(await agent.run("What tasks were assigned to me this week?"))
Who it's for
This tool is for developers building LlamaIndex agents that need to reason over email data. It suits teams that want email intelligence without building their own thread reconstruction and NLP pipelines.
Source README
LlamaIndex Tools Integration: iGPT Email Intelligence
This tool connects to iGPT to give your agent
structured, reasoning-ready context from connected email threads.
iGPT handles thread reconstruction, participant role detection, temporal
reasoning, and intent extraction before returning results - so agents
receive clean, structured JSON instead of raw message data.
To begin, you need to obtain an API key at docs.igpt.ai.
Usage
### %pip install llama-index llama-index-core llama-index-tools-igpt-email
from llama_index.tools.igpt_email import IGPTEmailToolSpec
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI
tool_spec = IGPTEmailToolSpec(api_key="your-key", user="user-id")
agent = FunctionAgent(
tools=tool_spec.to_tool_list(),
llm=OpenAI(model="gpt-4.1"),
)
print(await agent.run("What tasks were assigned to me this week?"))
ask: Ask a question about email context using iGPT's reasoning engine. Returns structured context including tasks, decisions, owners, sentiment, deadlines, and citations.
search: Search email context for relevant messages and threads. Returns matching email context as Documents with thread metadata (subject, participants, date, thread ID).
This tool is designed to be used as a way to load data as a Tool in an Agent.
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.