# Data Model: Deep Research Agent Example

**Date**: 2026-03-30

## Entities

### CompositeBackend Routes

| Route Path | S3 Prefix Suffix | Purpose | Examples |
|------------|-----------------|---------|----------|
| `/memories/semantic/` | `memories/semantic` | Facts & knowledge | `user_preferences.md`, `ai_agents_overview.md` |
| `/memories/episodic/` | `memories/episodic` | Past experiences | `2026-03-30_ai_agents.md`, `session_log.md` |
| `/memories/procedural/` | `memories/procedural` | Instructions & rules | `report_format.md`, `citation_style.md` |
| `/memories/` | `memories` | Top-level memory (AGENTS.md) | `AGENTS.md` |
| `/skills/` | `skills` | Skill library | `linkedin-post/SKILL.md`, `twitter-post/SKILL.md` |
| `/conversation_history/` | `conversation_history` | Evicted conversation chunks | Auto-generated by summarization middleware |
| `/large_tool_results/` | `large_tool_results` | Oversized tool outputs | Auto-generated by filesystem middleware |

**Default backend**: `AgentCoreCodeInterpreterSandbox` — handles all paths not matched by routes above.

### Seed Files (uploaded by setup_backend.py)

| Local Path | S3 Destination | Content Source |
|------------|---------------|----------------|
| `memory/AGENTS.md` | `/memories/AGENTS.md` | Adapted from langgraph-101 with structured memory paths |
| `skills/linkedin-post/SKILL.md` | `/skills/linkedin-post/SKILL.md` | Copied from langgraph-101 |
| `skills/twitter-post/SKILL.md` | `/skills/twitter-post/SKILL.md` | Copied from langgraph-101 |

### Research Subagent

| Property | Value |
|----------|-------|
| Name | `research-agent` |
| Description | Delegate research tasks. Give one topic at a time. |
| Tools | `tavily_search` |
| Search limits | 2-3 (simple), up to 5 (complex) |
| Output format | Headings, inline citations [1][2][3], Sources section |

### Environment Variables

| Variable | Required | Default | Description |
|----------|----------|---------|-------------|
| `ANTHROPIC_API_KEY` | Yes | -- | Anthropic API key for Claude |
| `TAVILY_API_KEY` | Yes | -- | Tavily API key for web search |
| `AWS_REGION` | Yes | -- | AWS region for S3 and AgentCore |
| `S3_BACKEND_BUCKET` | Yes | -- | S3 bucket name |
| `S3_BACKEND_PREFIX` | No | `""` | S3 key prefix |
| `AWS_ACCESS_KEY_ID` | No | -- | AWS credentials (if not using IAM role) |
| `AWS_SECRET_ACCESS_KEY` | No | -- | AWS credentials |
| `AWS_SESSION_TOKEN` | No | -- | For temporary credentials |
| `LANGSMITH_API_KEY` | No | -- | LangSmith tracing |
| `LANGCHAIN_TRACING_V2` | No | `false` | Enable tracing |
| `LANGCHAIN_PROJECT` | No | -- | LangSmith project name |

## Relationships

```
graph.py
├── creates: CompositeBackend
│   ├── default: AgentCoreCodeInterpreterSandbox
│   └── routes: 7x S3Backend (each with unique prefix)
├── defines: tavily_search tool
├── defines: research_subagent dict
│   └── uses: tavily_search tool
├── loads: /memories/AGENTS.md (via memory= parameter)
├── loads: /skills/ (via skills= parameter)
└── exports: graph (create_deep_agent result)

main.py
└── imports: graph from graph.py

setup_backend.py
└── uploads: 3 seed files to S3
```
