deep-research
AGENTS.md4.7k starsChanged 19 months agoMITView on GitHub
This document provides essential guidelines and technical references for AI agents (and human developers) working on the Deep Research repository. Adhere to these patterns to ensure consistency, security, and maintainability. The project uses pnpm as the primary package manager.
- Reads credentials
- Deletes or force-pushes
Trending
Quiet since June.thin dataabout the whole repository
Who's talking about u14app/deep-research
- JSONbored/awesome-claude“content(mcp): add Deep Research MCP Server”GitHub · Jun 5, 2026
- AstrBotDevs/AstrBot“[Bug]MCP超时时间似乎对SubAgent未生效”GitHub · Mar 20, 2026
- looplj/axonhub“兼容性问题,部分项目无法拉取模型”GitHub · Jan 4, 2026
- metatool-ai/metamcp“MCP error -32001: Request timed out”GitHub · Sep 6, 2025
- open-webui/mcpo“issue: Method not found”GitHub · Jul 23, 2025
The biggest 5 of 6 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 6
Talked about on GitHub (6 times).
On GitHub · 6
- Jun 5, 2026content(mcp): add Deep Research MCP Server — JSONbored/awesome-claude0 reactions · 3 comments
- Mar 20, 2026[Bug]MCP超时时间似乎对SubAgent未生效 — AstrBotDevs/AstrBot0 reactions · 1 comment
- Jan 4, 2026兼容性问题,部分项目无法拉取模型 — looplj/axonhub0 reactions · 6 comments
- Sep 6, 2025MCP error -32001: Request timed out — metatool-ai/metamcp0 reactions · 7 comments
- Jul 23, 2025issue: Method not found — open-webui/mcpo0 reactions · 5 comments
1 more on GitHub
- Jun 30, 2025Proposal: Section on Deep Research — EthicalML/awesome-production-agentic-systems0 reactions · 4 comments
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
19 rules. About 1 is common, 4 are distinctive, and 14 are very specific to this project.
≈1
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
14
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 23
Guideline: If adding tests, use Vitest or Jest following standard Next.js patterns.
- Very specific: line 50
Zod: Use Zod for schema validation, especially for AI response parsing and API request bodies.
- Very specific: line 55
Client Components: Use "use client"; at the top of files that require browser APIs or React hooks (state, effects).
- Very specific: line 56
Dynamic Imports: Use Next.js dynamic() for heavy components or those that rely on browser-only libraries (e.g., MagicDown, Mermaid).
- Very specific: line 57
Hooks: Prefer custom hooks for complex logic (e.g., useDeepResearch, useKnowledge).
- Distinctive: line 62
Styling: Use Tailwind CSS. Follow mobile-first responsive design patterns.
- Very specific: line 64
I18n: All UI strings must use useTranslation from react-i18next.
- Very specific: line 70
Radash: Use radash utilities for common operations like pick, isString, isObject, etc.
- Very specific: line 74
Path Alias: Always use the @/ prefix for absolute imports from the src directory.
- Very specific: line 88
Use the parseError utility from @/utils/error.ts to standardize error messages.
- Very specific: line 102
Never commit .env or .env.local files.
- Common: line 108
Secrets: Do not hardcode API keys or credentials.
- Distinctive: line 109
Sanitization: Use Zod to sanitize and validate all external inputs (web search results, user input).
- Very specific: line 110
Destructive Actions: Avoid rm -rf or history rewriting in git unless explicitly requested.
- Distinctive: line 116
Read First: Always read the relevant file and its neighbors before proposing edits.
- Very specific: line 117
Follow Patterns: If adding a new component, look at src/components/Research/SearchResult.tsx for a reference implementation.
- Very specific: line 119
Validate: Run pnpm lint and pnpm build to ensure your changes don't break the build.
- Distinctive: line 121
Clarity: Prefer clarity and simplicity over cleverness.
- Very specific: line 122
UI Consistency: Ensure all new UI elements support both light and dark modes using Tailwind dark: classes.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md
This document provides essential guidelines and technical references for AI agents (and human developers) working on the Deep Research repository. Adhere to these patterns to ensure consistency, security, and maintainability.
🚀 Development Workflow & Commands
The project uses pnpm as the primary package manager.
Core Commands
- Install Dependencies:
pnpm install - Development Server:
pnpm dev(Runs athttp://localhost:3000) - Build Project:
pnpm build - Static Export:
pnpm build:export(Generatesout/directory) - Standalone Build:
pnpm build:standalone - Linting:
pnpm lint
Testing
- Status: Currently, there are no automated tests in the codebase.
- Guideline: If adding tests, use Vitest or Jest following standard Next.js patterns. Place test files next to the code they test (e.g.,
ComponentName.test.tsx) or in a__tests__directory. - Single Test: To run a single test (if added), use
pnpm vitest run path/to/file.test.ts.
📂 Project Structure
src/app: Next.js App Router (Pages, API routes, Layouts).src/components: UI components.ui/: Shadcn primitives.Internal/: Custom shared components.Research/,Knowledge/, etc.: Feature-specific components.
src/hooks: Custom React hooks for business logic and state interaction.src/libs: External service integrations (e.g., MCP server logic).src/store: Zustand stores for global state and persistence.src/utils: Helper functions and core deep research logic.src/locales: I18n translation files (JSON).
🎨 Code Style & Conventions
1. TypeScript & Types
- Strict Mode:
strict: trueis enabled intsconfig.json. Always provide explicit types for function parameters and return values. - Global Types: Core business logic types (e.g.,
SearchTask,Knowledge,Source) are defined insrc/types.d.ts. Check this file before creating new interfaces. - Explicit Any: While
@typescript-eslint/no-explicit-anyis currentlyoff, avoidanyunless absolutely necessary for external library compatibility. Preferunknownor specific interfaces. - Zod: Use Zod for schema validation, especially for AI response parsing and API request bodies. See
src/app/api/mcp/server.tsfor examples.
2. React & Next.js
- App Router: This project uses the Next.js App Router.
- Client Components: Use
"use client";at the top of files that require browser APIs or React hooks (state, effects). - Dynamic Imports: Use Next.js
dynamic()for heavy components or those that rely on browser-only libraries (e.g.,MagicDown,Mermaid). - Hooks: Prefer custom hooks for complex logic (e.g.,
useDeepResearch,useKnowledge).
3. Components & UI
- Shadcn UI: UI primitives are located in
@/components/ui. Do not modify them directly; extend them or create wrappers insrc/components/Internal. - Styling: Use Tailwind CSS. Follow mobile-first responsive design patterns.
- Icons: Use lucide-react.
- I18n: All UI strings must use
useTranslationfromreact-i18next. Uset("key.path")for all labels.
4. State Management
- Zustand: Used for global state and persistence.
- Persistence: Most stores use the
persistmiddleware (e.g.,useTaskStoreinsrc/store/task.ts) to save research data inlocalStorage. - Radash: Use radash utilities for common operations like
pick,isString,isObject, etc.
5. Imports
- Path Alias: Always use the
@/prefix for absolute imports from thesrcdirectory. - Ordering:
- React/Next.js core
- Third-party libraries
- Components (Internal/UI)
- Hooks & Stores
- Utils & Types
🛠 Backend & API Patterns
1. Error Handling
- Use the
parseErrorutility from@/utils/error.tsto standardize error messages. - In async functions, use
try...catch...finallyto manage loading states and error reporting. - Standardized API error format:
{ isError: true, content: [{ type: "text", text: "..." }] }.
2. API Routes
- SSE API: Located at
src/app/api/sse. Handles real-time streaming research reports. - MCP Server: Located at
src/app/api/mcp. Implements the Model Context Protocol for tool use by other AI agents. - Proxying: The project proxies various AI and search providers via
next.config.tsrewrites to avoid CORS issues and manage keys.
3. Environment Variables
- Refer to
env.tplfor all available environment variables. - Critical variables include
GOOGLE_GENERATIVE_AI_API_KEY,TAVILY_API_BASE_URL, andACCESS_PASSWORD. - Never commit
.envor.env.localfiles.
🔒 Security & Safety
- Secrets: Do not hardcode API keys or credentials.
- Sanitization: Use Zod to sanitize and validate all external inputs (web search results, user input).
- Destructive Actions: Avoid
rm -rfor history rewriting in git unless explicitly requested.
🤖 Agent Instructions
- Read First: Always read the relevant file and its neighbors before proposing edits.
- Follow Patterns: If adding a new component, look at
src/components/Research/SearchResult.tsxfor a reference implementation. - Keep it Focused: Make small, cohesive changes. Avoid unrelated refactors.
- Validate: Run
pnpm lintandpnpm buildto ensure your changes don't break the build. - Communication: Summarize what changed, where, and why. Call out tradeoffs, assumptions, and known limitations. If validation could not be run, say so explicitly.
- Clarity: Prefer clarity and simplicity over cleverness. Preserve existing behavior unless the task explicitly requires changes.
- UI Consistency: Ensure all new UI elements support both light and dark modes using Tailwind
dark:classes.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

