{"id":28393426,"url":"https://github.com/hatchet-dev/hatchet-typescript-deep-research","last_synced_at":"2025-10-14T01:05:05.400Z","repository":{"id":294258992,"uuid":"986418630","full_name":"hatchet-dev/hatchet-typescript-deep-research","owner":"hatchet-dev","description":"Example of how to implement the Deep Research Agentic AI Search Pattern with Hatchet","archived":false,"fork":false,"pushed_at":"2025-09-30T11:26:09.000Z","size":387,"stargazers_count":6,"open_issues_count":7,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-30T13:23:00.203Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hatchet-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-05-19T15:21:32.000Z","updated_at":"2025-09-30T11:25:37.000Z","dependencies_parsed_at":"2025-06-04T12:52:19.793Z","dependency_job_id":"637a39d7-48e4-4572-b10b-9bbbf8d3d79d","html_url":"https://github.com/hatchet-dev/hatchet-typescript-deep-research","commit_stats":null,"previous_names":["hatchet-dev/hatchet-typescript-deep-research"],"tags_count":0,"template":false,"template_full_name":"hatchet-dev/hatchet-typescript-quickstart","purl":"pkg:github/hatchet-dev/hatchet-typescript-deep-research","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hatchet-dev%2Fhatchet-typescript-deep-research","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hatchet-dev%2Fhatchet-typescript-deep-research/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hatchet-dev%2Fhatchet-typescript-deep-research/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hatchet-dev%2Fhatchet-typescript-deep-research/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hatchet-dev","download_url":"https://codeload.github.com/hatchet-dev/hatchet-typescript-deep-research/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hatchet-dev%2Fhatchet-typescript-deep-research/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279017454,"owners_count":26086080,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-31T16:12:36.065Z","updated_at":"2025-10-14T01:05:05.394Z","avatar_url":"https://github.com/hatchet-dev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deep Research Agent\n\nThis is an example agent which performs deep research using [Hatchet](https://hatchet.run/) and [OpenAI](https://openai.com/). While the agent itself is very simple, it is based on best practices that we have observed at Hatchet while executing billions of tasks and agent executions per month. It is intended to be a forkable starting point for agentic ai projects. \n\n## Demo\n\n**Video demo:**\n\nhttps://github.com/user-attachments/assets/d99f8ae2-8ce5-4ce3-9792-d10c1038e413\n\n[**Example report**](./results/20250519_Renewables.md)\n\n## FAQs\n\n**What's the purpose of this repository?**\n\nThis is a starting point for building an agent in your own product -- it is not meant as a replacement for Deep Research.\n\n**What is Hatchet?**\n\nHatchet is an orchestration engine which turns functions into [durable tasks](https://docs.hatchet.run/home/durable-execution) that execute **in parallel** on many machines at once, which helps turn your agents from great demos into fast, reliable production code.\n\n**Does this use a framework?**\n\nWe believe **the best framework is no framework**. See [further reading](#further-reading) below for more information.\n\n## Getting Started\n\n\u003e [!CAUTION]\n\u003e Running this example is _free on Hatchet (below 1000 tasks/day)_ but will _cost money on OpenAI_. As this is an unconstrained agent, please make sure you are testing this against a low usage limit.\n\n1. Clone the repo:\n\n```\ngit clone https://github.com/hatchet-dev/hatchet-typescript-deep-research.git\n```\n\n2. Generate a Hatchet API token on [Hatchet Cloud](https://cloud.onhatchet.run/) (or [run Hatchet with docker-compose](https://docs.hatchet.run/self-hosting/hatchet-lite)), along with an OpenAI API key. Paste the following into a `.env` file in the root of this directory:\n\n```bash\nOPENAI_API_KEY=\u003cyour_api_key_here\u003e\nHATCHET_CLIENT_TOKEN=\u003cyour_hatchet_token\u003e\n```\n\n3. Install dependencies:\n\n```bash\npnpm install\n```\n\n4. Run the development server:\n\n```bash\npnpm dev\n```\n\n5. Trigger your first deep research execution, which will ask you for a prompt (or select from the list):\n\n```bash\npnpm cli\n```\n\n## Extending this project\n\nThis project is designed as a starting point to build your own agent. The primary entrypoint for the agent can be found in [`src/agents/deep-research/deep-research.agent.ts`](./src/agents/deep-research/deep-research.agent.ts). Tasks (also known as tools) for the agent can be found in the [tasks folder](./src/agents/deep-research/tasks).\n\nThe agent implements the following control loop:\n\n```mermaid\nflowchart TD\n    Start([Start]) --\u003e Input[/User Query/]\n    Input --\u003e InitVars[Initialize Variables]\n\n    subgraph IterationLoop[\"Iteration Loop (max 3 iterations)\"]\n        InitVars --\u003e PlanSearch[Plan Search: based on query, existing facts, and missing aspects]\n        PlanSearch --\u003e|x N| SearchQueries[Execute Search Queries]\n        SearchQueries --\u003e ProcessSources[Process \u0026 Deduplicate Sources]\n        ProcessSources --\u003e |x M| ConvertToMd[Convert Sources to Markdown]\n        ConvertToMd --\u003e ExtractFacts[Extract Facts from Sources]\n        ExtractFacts --\u003e JudgeFacts[Judge if Facts are Sufficient]\n        JudgeFacts --\u003e Decision{Enough Facts or Max Iterations?}\n        Decision --\u003e|No| UpdateMissing[Update Missing Aspects]\n        UpdateMissing --\u003e PlanSearch\n    end\n\n    Decision --\u003e|Yes| GenerateSummary[Generate Final Summary]\n    GenerateSummary --\u003e JudgeResults[Judge Final Results]\n    JudgeResults --\u003e ReturnResult[Return Result]\n    ReturnResult --\u003e End([End])\n\n    %% Light grayscale fill with dark text\n    classDef process fill:#f5f5f5,stroke:#24292e,stroke-width:1px,color:#24292e;\n    classDef decision fill:#eeeeee,stroke:#24292e,stroke-width:1px,color:#24292e;\n    classDef io fill:#f0f0f0,stroke:#24292e,stroke-width:1px,color:#24292e;\n\n    class PlanSearch,SearchQueries,ProcessSources,ConvertToMd,ExtractFacts,JudgeFacts,GenerateSummary,JudgeResults,UpdateMissing process;\n    class Decision decision;\n    class Input,ReturnResult io;\n```\n\n## Further reading\n\nTo learn more about Hatchet, visit:\n\n- [Hatchet Documentation](https://docs.hatchet.run)\n- [Hatchet GitHub Repository](https://github.com/hatchet-dev/hatchet)\n\nTo learn more about what informs our agent design and architecture, see:\n\n- [12-factor agents](https://github.com/humanlayer/12-factor-agents)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhatchet-dev%2Fhatchet-typescript-deep-research","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhatchet-dev%2Fhatchet-typescript-deep-research","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhatchet-dev%2Fhatchet-typescript-deep-research/lists"}