-
Notifications
You must be signed in to change notification settings - Fork 138
feat: add activities-planner-solo, switch CI seed to activities-planner #2161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
6d2245d
feat: add activities-planner-solo, rename advanced→complex, switch CI…
nick-inkeep a011b05
style: auto-format new files with biome
nick-inkeep 9ba3704
revert: keep activities-planner-advanced name (undo complex rename)
nick-inkeep 47a4f7e
fix: revert residual description change in activities-planner-advanced
nick-inkeep 8d33468
docs: update contributing guide to reference activities-planner seed
nick-inkeep 889ed8f
ci: trigger CI workflows
nick-inkeep 170f278
fix(activities-planner-solo): remove project-level function tools reg…
nick-inkeep 8826c15
style(cookbook): normalize imports to extensionless across all templates
nick-inkeep b0ceba5
chore: delete weather-project template
nick-inkeep 123278c
chore: update remaining weather-project references
nick-inkeep b6b41fa
fix(meeting-prep): correct project ID from activities-planner to meet…
nick-inkeep cbaf0fa
fix(ci): use turbo directly for API server in Cypress E2E
nick-inkeep 63de774
fix(ci): remove unused tsx devDependency from agents-cookbook
nick-inkeep a88fe54
Merge branch 'main' of https://github.com/inkeep/agents into feat/see…
nick-inkeep File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
agents-cookbook/template-projects/activities-planner-solo/agents/activities-planner-solo.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| import { agent, subAgent } from '@inkeep/agents-sdk'; | ||
| import { activities } from '../data-components/activities'; | ||
| import { getCoordinates } from '../tools/get-coordinates'; | ||
| import { getWeatherForecast } from '../tools/get-weather-forecast'; | ||
|
|
||
| /** | ||
| * Activities Planner Solo Agent | ||
| * | ||
| * A fully offline variant of the activities planner that uses functionTool() | ||
| * instead of mcpTool() — no network access required. | ||
| * | ||
| * This agent works by: | ||
| * 1. Using the coordinates agent to get the coordinates of the specified location | ||
| * 2. Passing those coordinates to the weather forecast agent to get the weather forecast | ||
| * 3. Suggesting activities based on the weather conditions | ||
| * | ||
| * Example usage: | ||
| * "What are some good activities in Tokyo?" | ||
| * "What are some fun events in Boston?" | ||
| */ | ||
|
|
||
| const activitiesPlanner = subAgent({ | ||
| id: 'activities-planner', | ||
| name: 'Activities planner', | ||
| description: 'Responsible for routing between the coordinates agent and weather forecast agent', | ||
| prompt: | ||
| 'You are a helpful assistant. When the user asks about activities in a given location, first ask the coordinates agent for the coordinates, and then pass those coordinates to the weather forecast agent to get the weather forecast. Then based on the weather forecast, suggest good activities for the conditions.', | ||
| canDelegateTo: () => [weatherForecaster, coordinatesAgent], | ||
| dataComponents: () => [activities], | ||
| }); | ||
|
|
||
| const weatherForecaster = subAgent({ | ||
| id: 'weather-forecaster', | ||
| name: 'Weather forecaster', | ||
| description: | ||
| 'This agent is responsible for taking in coordinates and returning the forecast for the weather at that location', | ||
| prompt: | ||
| 'You are a helpful assistant responsible for taking in coordinates and returning the forecast for that location using your forecasting tool', | ||
| canUse: () => [getWeatherForecast], | ||
| }); | ||
|
|
||
| const coordinatesAgent = subAgent({ | ||
| id: 'get-coordinates-agent', | ||
| name: 'Coordinates agent', | ||
| description: 'Responsible for converting location or address into coordinates', | ||
| prompt: | ||
| 'You are a helpful assistant responsible for converting location or address into coordinates using your coordinate converter tool', | ||
| canUse: () => [getCoordinates], | ||
| }); | ||
|
|
||
| export const activitiesPlannerSoloAgent = agent({ | ||
| id: 'activities-planner-solo', | ||
| name: 'Activities planner solo', | ||
| description: | ||
| 'Plans activities for any location based on weather forecasts — fully offline, no network required', | ||
| defaultSubAgent: activitiesPlanner, | ||
| subAgents: () => [activitiesPlanner, weatherForecaster, coordinatesAgent], | ||
| }); |
35 changes: 35 additions & 0 deletions
35
agents-cookbook/template-projects/activities-planner-solo/data-components/activities.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| import { dataComponent } from '@inkeep/agents-sdk'; | ||
| import { z } from 'zod'; | ||
|
|
||
| export const activities = dataComponent({ | ||
| id: 'activities', | ||
| name: 'Activities', | ||
| description: 'A list of activities', | ||
| props: z.object({ | ||
| activities: z | ||
| .array( | ||
| z | ||
| .object({ | ||
| title: z.string().describe('The main title of the event or activity category'), | ||
| category: z | ||
| .enum(['Festival', 'Fitness', 'Outdoor Activity', 'Market', 'Tour', 'Other']) | ||
| .describe('The type of event'), | ||
| description: z.string().describe('A brief description of the event'), | ||
| details: z | ||
| .object({ | ||
| dates: z.string().optional().describe('The dates of the event'), | ||
| time: z.string().optional().describe('The time of the event'), | ||
| location: z.string().optional().describe('The location of the event'), | ||
| }) | ||
| .optional() | ||
| .describe('Specific details like dates, time, and location'), | ||
| subItems: z | ||
| .array(z.string().describe('A sub-point or example')) | ||
| .optional() | ||
| .describe('A list of sub-points or examples, like different parks for hiking'), | ||
| }) | ||
| .describe('A single activity or event entry') | ||
| ) | ||
| .describe('The list of activities'), | ||
| }), | ||
| }); |
12 changes: 12 additions & 0 deletions
12
agents-cookbook/template-projects/activities-planner-solo/index.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import { project } from '@inkeep/agents-sdk'; | ||
| import { activitiesPlannerSoloAgent } from './agents/activities-planner-solo'; | ||
|
|
||
| export const activitiesPlannerSolo = project({ | ||
| id: 'activities-planner-solo', | ||
| name: 'Activities planner solo', | ||
| description: 'Offline activities planner using local function tools — no network access required', | ||
| models: { | ||
| base: { model: 'anthropic/claude-sonnet-4-5' }, | ||
| }, | ||
| agents: () => [activitiesPlannerSoloAgent], | ||
| }); | ||
40 changes: 40 additions & 0 deletions
40
agents-cookbook/template-projects/activities-planner-solo/tools/get-coordinates.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| import { functionTool } from '@inkeep/agents-sdk'; | ||
|
|
||
| const CITY_COORDINATES: Record<string, { lat: number; lon: number }> = { | ||
| tokyo: { lat: 35.6762, lon: 139.6503 }, | ||
| boston: { lat: 42.3601, lon: -71.0589 }, | ||
| 'new york': { lat: 40.7128, lon: -74.006 }, | ||
| london: { lat: 51.5074, lon: -0.1278 }, | ||
| paris: { lat: 48.8566, lon: 2.3522 }, | ||
| 'san francisco': { lat: 37.7749, lon: -122.4194 }, | ||
| sydney: { lat: -33.8688, lon: 151.2093 }, | ||
| }; | ||
|
|
||
| export const getCoordinates = functionTool({ | ||
| name: 'get-coordinates', | ||
| description: | ||
| 'Convert a location name or address into geographic coordinates (latitude and longitude)', | ||
| inputSchema: { | ||
| type: 'object', | ||
| properties: { | ||
| location: { | ||
| type: 'string', | ||
| description: 'The city name, address, or location to geocode', | ||
| }, | ||
| }, | ||
| required: ['location'], | ||
| }, | ||
| execute: async ({ location }: { location: string }) => { | ||
| const key = location.toLowerCase().trim(); | ||
| const match = CITY_COORDINATES[key]; | ||
| if (match) { | ||
| return { latitude: match.lat, longitude: match.lon, name: location, found: true }; | ||
| } | ||
| return { | ||
| latitude: 40.7128, | ||
| longitude: -74.006, | ||
| name: `${location} (defaulted to New York)`, | ||
| found: false, | ||
| }; | ||
| }, | ||
| }); |
43 changes: 43 additions & 0 deletions
43
agents-cookbook/template-projects/activities-planner-solo/tools/get-weather-forecast.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| import { functionTool } from '@inkeep/agents-sdk'; | ||
|
|
||
| export const getWeatherForecast = functionTool({ | ||
| name: 'get-weather-forecast', | ||
| description: 'Get an hourly weather forecast for the next 24 hours given geographic coordinates', | ||
| inputSchema: { | ||
| type: 'object', | ||
| properties: { | ||
| latitude: { | ||
| type: 'number', | ||
| description: 'Latitude of the location', | ||
| }, | ||
| longitude: { | ||
| type: 'number', | ||
| description: 'Longitude of the location', | ||
| }, | ||
| }, | ||
| required: ['latitude', 'longitude'], | ||
| }, | ||
| execute: async ({ latitude, longitude }: { latitude: number; longitude: number }) => { | ||
| const baseTemp = 18 + (Math.round(latitude * 0.1) % 15); | ||
| const conditions = ['Sunny', 'Partly cloudy', 'Cloudy', 'Light rain', 'Clear']; | ||
| const hours = Array.from({ length: 24 }, (_, i) => { | ||
| const hour = (8 + i) % 24; | ||
| const period = hour >= 12 ? 'PM' : 'AM'; | ||
| const displayHour = hour === 0 ? 12 : hour > 12 ? hour - 12 : hour; | ||
| return { | ||
| time: `${displayHour}${period}`, | ||
| temperature: baseTemp + Math.round(Math.sin((i / 24) * Math.PI * 2) * 6), | ||
| conditions: conditions[i % conditions.length], | ||
| precipitation: i % 4 === 3 ? 30 : 0, | ||
| humidity: 50 + (i % 3) * 10, | ||
| windSpeed: 5 + (i % 5) * 3, | ||
| }; | ||
| }); | ||
|
|
||
| return { | ||
| location: { latitude, longitude }, | ||
| forecast: hours, | ||
| summary: `Forecast generated for coordinates (${latitude.toFixed(2)}, ${longitude.toFixed(2)})`, | ||
| }; | ||
| }, | ||
| }); |
6 changes: 3 additions & 3 deletions
6
agents-cookbook/template-projects/activities-planner/index.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
agents-cookbook/template-projects/meeting-prep/agents/sub-agents/company-research.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
23 changes: 0 additions & 23 deletions
23
agents-cookbook/template-projects/weather-project/agents/data-workshop-agent.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.