Setting Up Your Agent Environment

Memory Graph, Voice & Email Integration

4 min read

So far your agent can think and communicate. But it cannot remember what happened last week, hear your voice, or send an email on your behalf. These three integrations — memory, voice, and email — transform your agent from a reactive chatbot into a proactive system that accumulates knowledge, accepts natural input, and takes real-world action.

Obsidian as a Memory Graph

An agent without persistent memory is like an employee who forgets everything at the end of each day. You need a structured, searchable knowledge base that your agent can both read from and write to.

Obsidian is a markdown-based note-taking application that stores files locally as plain text. This makes it an excellent memory backend for agents because:

  • Files are plain markdown — the agent can read and write them with standard file operations
  • The link graph — Obsidian's [[wikilink]] syntax creates a navigable knowledge graph between notes
  • Local-first — no cloud dependency, data stays on your machine or VPS
  • Human-readable — you can browse and edit the same knowledge base your agent uses

How the Agent Uses Obsidian

The agent interacts with an Obsidian vault (a folder of markdown files) through file system access:

There is no vault setting to fill in. An Obsidian vault is a folder of .md files, so "wiring it up" means giving the agent a tool that reads and writes inside one directory — the same shape as any other custom tool you have built:

import os
from pathlib import Path
from crewai.tools import tool

VAULT = Path(os.environ["OBSIDIAN_VAULT"]).resolve()


def _safe(name: str) -> Path:
    p = (VAULT / f"{name}.md").resolve()
    if VAULT not in p.parents:                 # blocks ../../etc/passwd style names
        raise ValueError("note name escapes the vault")
    return p


@tool("read_note")
def read_note(name: str) -> str:
    """Read one note from the vault by title. Returns empty string if it does not exist."""
    p = _safe(name)
    return p.read_text(encoding="utf-8") if p.exists() else ""

That _safe check is the whole security story for filesystem tools, and it is the line people leave out. An agent composes the filename from model output; without the containment check, a note titled ../../.ssh/id_rsa is a file read outside the vault.

With tools of that shape, the agent can:

  1. Store new knowledge: After completing a research task, the agent creates a new note with findings and links it to related notes
  2. Recall past context: Before responding, the agent searches the vault for relevant prior knowledge
  3. Build connections: The agent creates [[links]] between related concepts, building a knowledge graph over time
# Example: Agent creating a linked note
def save_research(topic, findings, related_topics):
    note_content = f"# {topic}\n\n"
    note_content += f"{findings}\n\n"
    note_content += "## Related\n"
    for related in related_topics:
        note_content += f"- [[{related}]]\n"

    # Write to Obsidian vault
    with open(f"{vault_path}/{topic}.md", "w") as f:
        f.write(note_content)

The compound effect is significant — after weeks of operation, the agent has built a rich knowledge graph of your projects, preferences, and decisions that it can reference in future interactions.

Whisper for Voice Transcription

Sometimes typing is impractical. You are walking, driving, or simply thinking faster than you can type. Voice input solves this by letting you speak naturally and having the agent process your words as text.

OpenAI's Whisper is an open-source speech recognition model that converts audio to text with high accuracy across many languages.

Integration Flow

The voice pipeline works like this:

  1. You send a voice message (via Telegram voice note, a recording app, or a microphone)
  2. The audio file is passed to Whisper for transcription
  3. The transcribed text is fed to your agent as a regular text input
  4. The agent processes it and responds through the normal channel
# Voice transcription integration
import whisper

# Load the model (options: tiny, base, small, medium, large)
model = whisper.load_model("base")

def transcribe_voice(audio_path):
    """Convert voice audio to text using Whisper."""
    result = model.transcribe(audio_path)
    return result["text"]

# Example usage in an agent pipeline
voice_text = transcribe_voice("/tmp/voice_message.ogg")
agent_response = agent.process(voice_text)

Model size trade-offs:

ModelSpeedAccuracyVRAM Required
tinyFastestGood for clear speechMinimal
baseFastGood general accuracyLow
smallModerateBetter accuracyModerate
mediumSlowerHigh accuracyHigher
largeSlowestHighest accuracySignificant

For most agent use cases, the base or small model provides the best balance of speed and accuracy.

AgentMail for Email Integration

Email remains one of the most important communication channels in professional life. Giving your agent its own email address unlocks powerful workflows — the agent can receive emails, draft responses, send notifications, and manage correspondence.

AgentMail is one of a growing set of services built specifically to give AI agents their own inboxes, rather than borrowing a human's. It came out of Y Combinator's Summer 2025 batch and raised a $6M seed round led by General Catalyst in March 20261 — useful mainly as a signal that "email infrastructure aimed at agents" is now a real category with more than one vendor in it, not as a reason to pick this one. Compare on the four points below and on current pricing, both of which are on their site.

Why a Dedicated Email Service

You could configure a standard email provider, but agent-specific email services offer advantages:

  • API-first design — built for programmatic access, not human inboxes
  • Deliverability — pre-configured for high deliverability rates
  • Multiple addresses — easily provision different email addresses for different agent roles
  • Webhook support — incoming emails trigger agent actions automatically

Wiring it in

Same pattern as every other integration in this course: the provider gives you an HTTP API, you wrap it in a tool, the agent calls the tool. Check the vendor's current SDK and endpoint names in their own docs rather than copying a signature from here — API surfaces move, and a wrong method name is a five-minute fix only if you know to look for it.

The part that is not boilerplate is the receive side. Incoming mail arrives as a webhook, which means your agent now has an entry point reachable by anyone who learns the address:

# Handling incoming email
def on_email_received(email):
    """Process incoming email and generate a response."""
    sender = email["from"]
    subject = email["subject"]
    body = email["body"]

    # Agent analyzes the email
    analysis = agent.process(
        f"Incoming email from {sender}, "
        f"subject: {subject}. Body: {body}"
    )

    # Draft response if appropriate
    if analysis.should_respond:
        send_email(
            to=sender,
            subject=f"Re: {subject}",
            body=analysis.draft_response
        )

The Multi-Modal Input System

When you combine these three integrations, you create a multi-modal input system where your agent can receive information through multiple channels:

Input MethodWhen to UseAgent Action
Text (Telegram/Discord)At your desk, precise instructionsDirect processing
Voice (Whisper)On the go, brainstormingTranscribe then process
Email (AgentMail)Formal communication, external contactsParse, respond, or escalate
Memory (Obsidian)Background referenceRetrieve relevant context

The power is in the combination. You send a voice note while walking: "Research the competitor's pricing page and email me a summary." The agent transcribes your voice, performs web research, stores findings in Obsidian, and emails you a formatted summary — all triggered by a single voice message.

Key takeaway: Memory, voice, and email transform your agent from a simple conversational interface into a knowledge-accumulating, multi-modal system. Obsidian gives it persistent memory, Whisper gives it ears, and AgentMail gives it a professional communication channel. Together, they create an agent that grows more capable over time.

Next: Keeping your agent running around the clock with mission control and always-on operations. :::

Footnotes

  1. AgentMail raises $6M to build an email service for AI agents — TechCrunch, 10 March 2026.

Quiz

Module 2 Quiz: Setting Up Your Agent Environment

Take Quiz
Was this lesson helpful?

Sign in to rate