n8n orchestrates the entire system, handling data processing, classification, and interactions.
Create n8n Account
- Sign up for n8n Cloud or set up a self-hosted instance
- Create a new workflow
Import the Cosmos Workflow
- Download the provided
Cosmos_RAG_Agent.json
file
- In n8n, go to Workflows → Import From File
- Upload the JSON file
Configure Credentials
Set up the following API credentials in n8n:
- OpenAI API
- Create an API key at OpenAI
- In n8n, go to Settings → Credentials
- Add a new credential for OpenAI with your API key
- Pinecone API
- Use the API key from your Pinecone dashboard
- Add a new credential for Pinecone
- Supabase API
- From your Supabase project dashboard, get:
- Project URL
- API key (under Project Settings → API)
- Add a new credential for Supabase
- Zep API (for memory)
- Set up a Zep instance or sign up for a cloud account
- Get your API key
- Add a new credential for Zep
- RapidAPI (for YouTube transcripts)
- Sign up at RapidAPI
- Subscribe to the YouTube Transcript API
- Add your API key to the Transcribe node
- Tavily API (for news search)
- Get an API key from Tavily
- Update the Tavily HTTP Request node with your key
- Google Drive (optional)
- Set up OAuth2 credentials if you want Google Drive integration
Configure Webhooks
The workflow uses several webhooks to handle different types of requests:
- Main chat webhook -
/chat