Rag avatar

Rag

Pricing

Pay per usage

Go to Apify Store
Rag

Rag

Interviews RAG — An Actor that answers questions about customer meeting notes using RAG. It searches a Pinecone vector store for relevant transcript chunks, ranks results by semantic similarity and recency, then generates answers. Runs in Standby mode as an HTTP service, exposing a /query endpoint.

Pricing

Pay per usage

Rating

0.0

(0)

Developer

Jan Ženíšek

Jan Ženíšek

Maintained by Community

Actor stats

0

Bookmarked

1

Total users

0

Monthly active users

6 hours ago

Last modified

Categories

Share

Interviews RAG Actor

An Apify Actor that performs Retrieval-Augmented Generation (RAG) on meeting notes stored in Pinecone vector store. It retrieves relevant context and generates answers using GPT-4o.

This Actor runs only in Standby mode as an HTTP server for real-time API requests.

Features

  • Vector Search: Retrieves relevant documents from Pinecone using similarity search
  • GPT-4o Integration: Generates comprehensive answers using OpenAI's GPT-4o model
  • Citation Support: Includes source citations with Notion URLs and dates
  • Recency-Aware Ranking: Balances semantic similarity with document freshness
  • Standby Mode: Runs as an HTTP server for real-time API requests
  • Configurable: Adjustable retrieval parameters (k, threshold, recency)
  • Per-Request Overrides: API keys, index name, LLM model, and all parameters can be overridden per request

Configuration

Default configuration is loaded from environment variables. All parameters can be overridden per-request.

VariableRequiredDescription
OPENAI_API_KEYOpenAI API key for embeddings and LLM
PINECONE_API_KEYPinecone API key
INDEX_NAMEPinecone index name containing embeddings
KNumber of documents to retrieve (default: 20)
THRESHOLDSimilarity threshold 0.0-1.0 (default: 0.3)
RECENCY_WEIGHTBalance between similarity and recency 0.0-1.0 (default: 0.2)
RECENCY_DECAY_DAYSHalf-life for recency scoring in days (default: 180)
START_TEMPLATECustom system prompt

Local Development

Create a .env file in the project root:

OPENAI_API_KEY=sk-your-openai-api-key
PINECONE_API_KEY=your-pinecone-api-key
INDEX_NAME=interviews
# Optional
K=20
THRESHOLD=0.3
RECENCY_WEIGHT=0.2

Apify Deployment

Configure environment variables in Actor Settings → Environment Variables on Apify Console.

API Endpoints

MethodPathDescription
GET/ or /healthHealth check and configuration status
POST/ or /querySubmit a RAG query
GET/query?question=...Submit query via URL parameters

POST Request

Endpoint: POST /query or POST /

Headers:

Content-Type: application/json

Request Body:

{
"question": "What did customers say about pricing?"
}

Per-request overrides:

All parameters below are optional. If not provided, values from environment variables are used.

ParameterTypeDescription
openai_api_keystringOverride OpenAI API key
pinecone_api_keystringOverride Pinecone API key
index_namestringOverride Pinecone index name
llm_modelstringLLM model (default: gpt-4o)
kintegerNumber of documents to retrieve (1-50)
thresholdnumberSimilarity threshold (0.0-1.0)
recency_weightnumberRecency vs similarity balance (0.0-1.0)
recency_decay_daysintegerHalf-life for recency scoring
start_templatestringCustom system prompt

Example with overrides:

{
"question": "What feedback did we get on the new feature?",
"openai_api_key": "sk-your-key",
"pinecone_api_key": "pc-your-key",
"index_name": "custom-index",
"llm_model": "gpt-4o-mini",
"k": 5,
"threshold": 0.7,
"recency_weight": 0.3,
"start_template": "Answer concisely based on the context."
}

Example with cURL:

curl -X POST https://your-actor.apify.actor/query \
-H "Content-Type: application/json" \
-d '{"question": "What are the main customer pain points?"}'

Response

{
"answer": "Based on the meeting notes, customers mentioned several pain points...",
"citations": [
{
"source_number": 1,
"notion_url": "https://notion.so/...",
"date": "2025-01-02"
}
],
"sources_used": 5
}

Error Response

{
"error": "Missing 'question' field in request body",
"error_type": "validation"
}

Local Development

# Create .env file with your credentials first
# Run locally in Standby mode
ACTOR_STANDBY_PORT=8080 apify run
# Deploy to Apify
apify login
apify push

How It Works

  1. Loads configuration from environment variables at startup
  2. Starts HTTP server listening for requests
  3. For each query:
    • Connects to Pinecone and retrieves relevant documents
    • Applies recency-aware ranking to prioritize fresh content
    • Formats context with source metadata
    • Generates answer using GPT-4o with citation instructions
    • Extracts and returns citations with the response