Each step is interactive (blocking) and waits for your input. Ensure OPENAI_API_KEY is set in your environment. Step 4 also reads .env.
Run:
npx tsx src/step1-agent-loop.tsWhat it adds:
- Minimal agent loop with two demo tools (weather, calculator)
- Sends system prompt + user message + tool list to the LLM
- Handles tool calls and prints a final response
Run:
npx tsx src/step2-db.tsWhat it adds:
- Memory via LowDB: stores all messages (system, user, assistant, tool)
- Resends the full conversation each turn to maintain context
- Conversation management: continue, list, switch, or start new
Run:
npx tsx src/step3-mcp.tsWhat it adds:
- MCP client: discovers and uses external tools (e.g., bash-mcp)
- Combines built-in tools with MCP tools seamlessly
- Executes tool results and feeds them back to the LLM
Run:
npx tsx src/step4-declarative-agents.tsWhat it adds:
- External
agent.yamlconfiguration defines agent behavior - System prompt, tools, and MCP servers are all configurable
- Quick feedback loop: change config and run!
That’s the progression: start with the loop (Step 1), add memory (Step 2), add external tools (Step 3), then move configuration out of code (Step 4) and you have your own Declarative Agentic Framework.