Skip to content

ChatGPT Plugin

PT | EN

Overview

OWN APP: Vectora functions as a Custom GPT Plugin that extends ChatGPT with codebase context search. Dedicated architecture with OpenAPI schema, ngrok/public endpoint, and OpenAI plugin store publishing.

Important

ChatGPT Custom GPT Plugin (own app) vs MCP Protocol (generic). Choose based on your IDE/platform preference.


Installation

Prerequisites

  • ChatGPT Plus (with Custom GPTs access)
  • Vectora server running (vectora mcp or vectora server)
  • Public endpoint or ngrok tunnel

Step 1: Configure Public Vectora Server

By default, Vectora runs on localhost:9090. For ChatGPT to reach it, expose it:

Option A: ngrok (Testing)

# Install ngrok
# https://ngrok.com

# Expose port 9090
ngrok http 9090

# Output:
# Forwarding: https://xxxx-xx-xxx-xx-x.ngrok.io -> http://localhost:9090

# Copy the URL

Option B: VPS with Public IP (Production)

# On your server
vectora server --host 0.0.0.0 --port 9090

# Expose via firewall
# iptables -A INPUT -p tcp --dport 9090 -j ACCEPT

Option C: Managed Vectora (Cloud)

# Register at https://console.vectora.app
# Get automatic endpoint
# https://api.vectora.app/v1/your-project-id

Step 2: Create Custom GPT in ChatGPT

  1. Go to chatgpt.com/gpts/editor
  2. Click “Create a new GPT”
  3. Name: “Vectora Codebase Assistant”
  4. Description: “Intelligent assistant for codebase analysis with Vectora”

Step 3: Configure OpenAPI Schema

In “Configure”“Actions”, add your Vectora endpoint:

openapi: 3.0.0
info:
  title: Vectora API
  version: 1.0.0
servers:
  - url: https://xxxx-xx-xxx-xx-x.ngrok.io # Your endpoint
paths:
  /search:
    post:
      summary: Search codebase context
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                query:
                  type: string
                  description: "Search query (semantic)"
                namespace:
                  type: string
                  description: "Project namespace"
                top_k:
                  type: integer
                  default: 10
      responses:
        "200":
          description: Search results
  /analyze-dependencies:
    post:
      summary: Find all usages of a function
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                function_name:
                  type: string
                namespace:
                  type: string
      responses:
        "200":
          description: Dependency analysis
  /file-summary:
    post:
      summary: Get file structure and summary
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                file_path:
                  type: string
                namespace:
                  type: string
      responses:
        "200":
          description: File summary

Step 4: Add System Instruction

In “Instructions” tab, copy:

You are an expert code analysis assistant using Vectora.

When user asks about code:
1. Use "search" action to find relevant context
2. Use "analyze-dependencies" to find related code
3. Use "file-summary" to understand structure

Always cite file and line when referencing code.
Prioritize accuracy over speed.

Good example:
"Found this in src/auth/jwt.ts:45:
function validateToken(token) { ... }"

Bad example:
"I think the function is somewhere"

Step 5: Publish

Click “Publish to Store” and share with your team.


Detailed Workflows

The workflows below demonstrate real-world use cases of Vectora integrated with ChatGPT, showing practical conversations and concrete results.

Workflow 1: Understanding Complex Feature (Onboarding)

Scenario: New dev wants to understand how JWT authentication works.

You: "How does the JWT authentication system work here?"

ChatGPT (with Vectora):
Found implementation in 3 main files:

1. **src/auth/jwt.ts** (definition)
   function validateToken(token: string) {
     const decoded = jwt.verify(token, SECRET_KEY);
     return decoded.payload;
   }

2. **src/guards/auth.guard.ts** (applied to routes)
   @UseGuards(AuthGuard)
   async getProfile(@Req() req) {
     // Already authenticated here
   }

3. **src/tests/auth.test.ts** (examples)
   it('should reject expired token', () => {
     // Test shows expected behavior
   })

**Flow**:
request → AuthGuard.canActivate() → validateToken() → req.user = payload

**Next steps**: Add your route like this...

Click any file → opens in editor/browser.

Workflow 2: Strategic Debugging

Scenario: You have an error and need to understand root cause.

You: "Test 'should create user' is failing with
     'Cannot read property id of undefined'.
     Where's the problem?"

ChatGPT (with Vectora):
Searching for test and related code...

**Found it!**

File: src/__tests__/user.service.test.ts:145
  it('should create user', () => {
    const user = userService.create({ name: 'John' });
    expect(user.id).toBeDefined(); // ← Fails here
  })

Analyzing userService.create():

  // src/services/user.service.ts:23
  create(data: CreateUserInput) {
    // Problem: doesn't return created user
    db.insert(users).values(data);
    // Should be:
    return db.insert(users).values(data).returning();
  }

**3 instances of this pattern in code:**
  • src/services/order.service.ts:34
  • src/services/product.service.ts:12
  • src/services/invoice.service.ts:88

**Suggestion**: Apply same fix in all 3 places.

Workflow 3: Assisted Code Review (Complex PR)

Scenario: Reviewing a PR that touches multiple auth files.

You: "Review this PR that refactors auth middleware.
     [paste 50 lines of code]"

ChatGPT (with Vectora):
Analyzing changes...

**Estimated Impact**: 12 files affected
- 8 route files (GET /profile, etc)
- 2 auth tests
- 2 guards

**Issues detected**:

1. Behavior changed at line 23
   BEFORE: guard.canActivate() returns boolean
   NOW: returns Promise<boolean>

   This breaks in 4 places:
   - src/routes/admin.ts:45
   - src/routes/api.ts:78
   - src/middleware/verify.ts:12
   - src/guards/optional.ts:3

2. Positive: New isTokenValid() method reused well
   (found 6 usages)

3. Security: GuardBlacklist properly respected
   (checks all 4 patterns)

**Related tests that MUST pass**:
□ auth.guard.test.ts
□ jwt.validation.test.ts
□ permission.test.ts
□ integration/auth-flow.test.ts

**Conclusion**: Approve with conditions:
1. Fix the 4 async/await files
2. Run full test suite
3. Verify: no SECRET_KEY exposed

Authentication & Security

Token-based Auth

If your server requires authentication:

# OpenAPI Schema
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

security:
  - bearerAuth: []

Configure in GPT:

Go to "Configure" → "Authentication"
Select "API Key"
Paste your token

Rate Limiting

Protect your server:

# In vectora config
server:
  rate_limit_per_hour: 1000
  max_concurrent: 5

Privacy & Compliance

What’s Sent to OpenAI

  • Your question (text)
  • Search parameters (namespace, top_k)
  • Chunks are NOT saved on OpenAI

What Stays Local

  • Vector indices (Qdrant)
  • Raw embeddings
  • API credentials

Encrypted Data

# Enable end-to-end encryption
vectora config set --key "ENCRYPT_TRANSIT" --value "true"

# SSL/TLS certificate
openssl req -x509 -newkey rsa:4096 -out cert.pem -keyout key.pem

# Use with HTTPS
vectora server --cert cert.pem --key key.pem

Troubleshooting

“Plugin not responding”

Cause: Vectora server offline.

Solution:

# Check if running
curl https://your-endpoint/health

# If returns 404, start it
vectora mcp

“Unauthorized”

Cause: Invalid or expired token.

Solution:

# Generate new token
vectora auth create-token --name "ChatGPT Plugin" --ttl 365d

# Update in Custom GPT settings

“Timeout”

Cause: Search too slow.

Solution:

# Reduce top_k
# In GPT instructions, modify to:
"Use top_k=5 instead of 10"

# Or increase timeout
curl -X POST https://your-endpoint/search \
  -H "Timeout: 10000" \
  -d "{...}"

Performance & Limits

ResourceLimitUpgrade
Searches/day10,000Pro Plan
Latency<2sSSD + more CPU
Response size5MBCompaction
Concurrent users10Managed Vectora

Advanced Examples

Custom GPT for Design Review

Instruction:
"You are a Design Reviewer powered by Vectora.
When user shows code:
1. Search for similar patterns in project
2. Evaluate consistency
3. Suggest improvements based on existing style guides
4. Cite codebase examples"

Custom GPT for Onboarding

Instruction:
"You are an Onboarding Assistant.
New engineers ask how code works.
Use Vectora to:
1. Search documentation
2. Find examples
3. List dependencies
4. Suggest files to read first"

Monitoring

Via Vectora console:

vectora logs --service chatgpt_plugin --level info

# Example output:
# [2026-04-19 10:30:45] POST /search - 200 - 234ms
# [2026-04-19 10:31:12] POST /analyze-dependencies - 200 - 156ms
# [2026-04-19 10:32:00] POST /file-summary - 200 - 89ms

Next: Gemini API


Part of Vectora ecosystem · Open Source (MIT)