Skip to content

🐛 [Bug]: #675

@john-savepoint

Description

@john-savepoint

Archon Version

0.1.0

Bug Severity

🟠 High - Blocks important features

Bug Description

🐛 [Bug]: Hybrid Search Functions Reference Non-Existent Column cp.embedding

Bug Description

The hybrid search functions in complete_setup.sql and add_hybrid_search_tsvector.sql reference a column cp.embedding that doesn't exist in the actual table schema, causing all RAG queries to return empty results.

Severity

Critical - RAG functionality completely broken

Error Message

Hybrid document search failed: {'message': 'column cp.embedding does not exist', 'code': '42703', 'hint': None, 'details': None}

Root Cause

The table schema uses dimension-specific embedding columns:

  • embedding_384
  • embedding_768
  • embedding_1024
  • embedding_1536 (for OpenAI text-embedding-3-small)
  • embedding_3072

But the hybrid search functions query cp.embedding which doesn't exist.

Affected Files

  • migration/complete_setup.sql
  • migration/add_hybrid_search_tsvector.sql

Code Issues

In both functions hybrid_search_archon_crawled_pages and hybrid_search_archon_code_examples:

❌ Current (Broken):

1 - (cp.embedding <=> query_embedding) AS vector_sim
FROM archon_crawled_pages cp
WHERE cp.embedding IS NOT NULL
ORDER BY cp.embedding <=> query_embedding

Impact

  • RAG search returns 0 results despite having crawled documents
  • MCP tools return empty responses
  • Knowledge base functionality completely broken
  • Fresh installations fail immediately

Environment

  • Archon version: Latest (as of 2025-09-16)
  • Database: Supabase/PostgreSQL with pgvector
  • Embedding model: OpenAI text-embedding-3-small (1536 dimensions)

Fix Required

Update both hybrid search functions to use embedding_1536 instead of embedding column references.

Priority

This should be fixed immediately as it breaks core functionality for all new installations.

Steps to Reproduce

Reproduction Steps

  1. Run complete_setup.sql on fresh Supabase database
  2. Start Archon services
  3. Crawl any documentation
  4. Try RAG search - returns 0 results
  5. Check logs: see "column cp.embedding does not exist" errors

Expected Behavior

should see rag

Actual Behavior

Can see there is docs, but the mcp returns nothing.

Error Details (if any)


Affected Component

🔍 Knowledge Base / RAG

Browser & OS

chrome

Additional Context

No response

Service Status (check all that are working)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

Status
Done (In Stable)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions