Context Engineering Demo - AI Research Assistant
A demo application showcasing Inngest’s context engineering capabilities including rate limiting, durable execution, parallel processing, and observability. This app gathers research context from multiple sources and generates AI-powered responses using OpenAI’s GPT-4.



Features
- 🔄 Parallel Context Gathering - Fetches from multiple sources simultaneously (ArXiv, GitHub, Vector DB, Web Search) while matching rate-limit constraints
- 🎯 Semantic Ranking - The retrieved context is ranked by relevance using embeddings
- 🧠 Specialized Agents - The context is provided to different specialized models in parallel with automatic retries powered by durable execution
- ⚡ Live Updates - Real-time updates streamed to frontend using Inngest Realtime
- Step-by-step progress indicators
- Per-source data fetching results
- AI response streaming (typewriter effect)
- Execution metadata (concurrency, throttling, rate limits)
- Error notifications and completion status
Tech Stack
- Framework: Next.js 15 (App Router)
- Language: TypeScript
- Orchestration: Inngest
- LLM: OpenAI GPT-4
- Vector DB: In-memory (demo) / Pinecone (production)
- UI: React + Tailwind CSS
- APIs: ArXiv, GitHub, Web Search
Getting Started
Prerequisites
- Node.js 18+ installed
- Vercel AI Gateway API Key (required)
- GitHub token (optional, for GitHub search)
- SerpAPI key (optional, for web search)
- Pinecone key (optional, for deployment)
Installation
- Clone the repository and install dependencies:
npm install
- Set up environment variables:
cp .env.example .env.local
Edit .env.local and add your API keys:
AI_GATEWAY_API_KEY=your_vercel-ai-gateway_api_key_here
# Optional: GITHUB_TOKEN, SERP_API_KEY, etc.
- Start the Inngest Dev Server (in a separate terminal):
npx inngest-cli@latest dev
This starts the Inngest Dev Server at http://localhost:8288 where you can see:
- Real-time function execution
- Step-by-step workflow progress
- Rate limiting in action
- Detailed logs and metrics
- Start the Next.js development server:
npm run dev
- Open your browser:
Navigate to http://localhost:3000
Usage
Try Sample Queries
- “What are the latest advances in transformer architectures?”
- “Explain retrieval-augmented generation”
- “How does rate limiting work in distributed systems?”
Viewing the Workflow
- Submit a query in the web UI
- Watch the real-time progress visualization
- Open the Inngest Dev Server at
http://localhost:8288
- Navigate to the “Runs” tab to see detailed execution
Environment Variables
Required
AI_GATEWAY_API_KEY - Vercel AI Gateway API Key
Optional (for development)
INNGEST_SIGNING_KEY - Inngest signing key (production only)
INNGEST_EVENT_KEY - Inngest event key (production only)
Optional (for full functionality)
GITHUB_TOKEN - GitHub personal access token for code search
PINECONE_API_KEY - Pinecone API key for vector search
PINECONE_ENVIRONMENT - Pinecone environment
SERP_API_KEY - SerpAPI key for web search
Development
Running Tests
npm test
Linting
npm run lint
Building for Production
npm run build
npm start
Deployment
Setting up Pinecone (optional)
To populate your Pinecone vector database with PDF documents:
-
Ensure your Pinecone index exists:
- Log into Pinecone Console
- Create an index named
test-inngest-context-engineering
- Dimension:
1536 (for OpenAI embeddings)
- Metric:
cosine
-
Upload a PDF:
npm run upload-pdf path/to/your/document.pdf
Or upload multiple PDFs:
npm run upload-pdf ./documents/\*.pdf
The script will:
- Extract text from the PDF
- Split it into ~1000 character chunks
- Generate embeddings using OpenAI
- Upload to your Pinecone index
Example:
npm run upload-pdf ./research-papers/transformer-architecture.pdf
Deploy to Vercel
- Push your code to GitHub
- Import the project in Vercel
- Add environment variables in Vercel dashboard
- Deploy!
Setup your Inngest production application
- Sign up at app.inngest.com
- Create a new app
- Get your signing key and event key
- Add them to your environment variables
- Point your production app to Inngest Cloud
Learn More
License
MIT
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.