A powerful AI-powered research assistant that conducts comprehensive research on any topic.
deepResearchAgent.ts
- The main research agent (HTTP endpoint)researchInterface.ts
- Web interface for interacting with the agenttestAgent.ts
- Test file to verify the agent is working correctlyThe easiest way to use the Deep Research Agent is through the web interface:
You can also call the research agent directly via its API endpoint:
POST https://deepResearchAgent.YOUR_USERNAME.val.town
Request body:
{ "topic": "Your research topic", "depth": "medium" // Options: "light", "medium", "deep" }
Response:
{ "success": true, "topic": "Your research topic", "research": { "topic": "Your research topic", "executiveSummary": "...", "subtopics": [ { "title": "Subtopic 1", "content": "...", "wordCount": 500 }, // More subtopics... ], "generatedAt": "2023-06-15T12:34:56.789Z", "depth": "medium" } }
To verify that the agent is working correctly, you can use the test endpoint:
GET https://testAgent.YOUR_USERNAME.val.town
This will run a simple test query and return the results.
If you encounter issues with the Deep Research Agent, try the following:
Check OpenAI API Access: Ensure your Val Town account has access to the OpenAI API.
Verify Endpoints: Make sure you're using the correct URLs for your Val Town username.
Check Console Logs: Open your browser's developer console to see any error messages.
Try a Simpler Topic: Start with a simple, well-known topic to test the agent.
Reduce Research Depth: Try using "light" depth which requires fewer API calls.
Check Response Format: If you're calling the API directly, ensure your request format is correct.
Run the Test Endpoint: Use the test endpoint to verify basic functionality.
You can modify the agent to suit your specific research needs:
generateSubtopics
functionresearchSubtopic
functionThis agent uses the OpenAI API via Val Town's standard library. No additional setup is required.