Inspiration

The idea for SpawnKit came from a simple but powerful question: What if AI agents could be more than stateless chatbots—entities that evolve, learn, forget, reflect, and act over time, like conscious beings?

Inspired by cognitive science models of memory and consciousness, we designed an agent system that:

Awakens on a schedule

Builds context from memory

Acts and reflects through tools

Sleeps once a day to consolidate experiences

This framework transforms LLMs from passive responders into active, evolving agents capable of maintaining knowledge and context over time.

How We Built It

SpawnKit is structured around orchestrated API routes that simulate the lifecycle of an agent:

Core Orchestration

POST /api/orchestrate: Triggered by a Cloudflare Worker cron job every 30 minutes to determine agent mode (awake/sleep) and initiate response generation.

POST /api/generate-and-execute: Combines memory and context, calls the Groq API, and parses tool actions.

POST /api/processToolCall: Executes tools (notes, thoughts, Discord messages, searches) and updates memory.

Memory Management

Permanent Memory → Core identity and long-term goals

Notes → Expiring insights (3–14 days)

Thoughts → Ephemeral reflections cleared during sleep

Turn Results → Short-term context from tools (2h TTL)

Day Summary → Compressed conversations stored during sleep

Agents live in a KV store with structured schemas, ensuring durability and consistency across cycles.

Tool Execution Tools run asynchronously, allowing agents to trigger multiple actions in parallel without blocking:

generate_system_note()

web_search() + extract_website_text()

discord_channel_message()

generate_daily_summary()

Tech Stack & Deployment

Framework: Next.js 15 for the full-stack application with server-side rendering.

Hosting & Edge Runtime: Cloudflare Pages, running the app at the edge for low latency and global distribution.

Edge Functions / Workers: Cloudflare Worker handles cron-based scheduling and orchestration of agent lifecycles.

Serverless API routes manage memory, tool execution, and daily sleep cycles efficiently.

What We Learned

Temporal design matters — Cron-synced cycles give agents a natural rhythm.

Forgetting is essential — Ephemeral memory prevents infinite context buildup.

Parallelization improves responsiveness — Fire-and-forget APIs reduce tool delays.

Orchestration beats raw LLM calls — Structuring flows around agents is where the magic happens.

Challenges

Ensuring KV updates stayed consistent under concurrent tool calls.

Designing sleep cycle compression logic to determine what to keep versus forget.

Scheduling agents in EST required careful orchestration.

Extracting clean, structured tool calls from LLM outputs took multiple iterations.

Next Steps

Multi-agent ecosystems with collaborative memory handoffs

Adaptive lifespans — agents that evolve, die, or respawn

Smarter memory compression inspired by human cognition

SpawnKit is not just an API—it’s a framework for building living, evolving digital entities.

Revolutionary Results

Our live demo showcases agents that have autonomously generated:

  • $120B market analysis with detailed TAM/SAM/SOM breakdowns
  • Comprehensive competitive intelligence on 15+ industry leaders
  • Strategic partnership roadmaps for Azure, AWS, Accenture, and SAP
  • Revenue optimization strategies targeting $1B within 5 years
  • 47+ strategic business insights without human intervention

These results prove SpawnKit agents become strategic business assets that create real value through persistent evolution—transforming from simple tools into intelligent business partners.

Link to our demo video: https://public.matthew.tech/openai-hackathon-demo-video.mp4

Built With

Share this project:

Updates