Context Search
The Context view lets you search across all your sessions using either exact text matching or semantic (meaning-based) search. Results can be copied and injected into new coding prompts, used in RAG pipelines, or exported for analysis.Search types
Full-text search
Matches exact terms againstsessions.searchableText, which concatenates the session title with all message text content. Uses Convex’s built-in search indexes for fast, ranked results.
Semantic search
Converts your query into a 1536-dimension vector using OpenAI’stext-embedding-3-small model and searches against the sessionEmbeddings table using cosine similarity.
Semantic search uses OpenAI embeddings. On self-hosted deployments, you need to set the
OPENAI_API_KEY environment variable. On the hosted version, this is already configured.How embeddings work
When a session is synced, OpenSync generates an embedding vector from the session’s searchable text. This vector is stored in thesessionEmbeddings table with:
| Field | Description |
|---|---|
sessionId | Reference to the session |
embedding | 1536-dimension float array |
textHash | Hash of the source text, used to skip re-embedding unchanged sessions |
createdAt | When the embedding was generated |
messageEmbeddings table.
Embeddings are generated asynchronously after session sync. There may be a brief delay before a newly synced session appears in semantic search results.
Using context search in the dashboard
Review results
Results show matched sessions ranked by relevance score. Each result includes a title, snippet, score, and link to the full session.
Using context search via API
Full-text
Semantic
Context endpoint (for RAG)
The dedicated/api/context endpoint returns results formatted for injection into LLM prompts:
Use cases
RAG pipelines
Inject past session knowledge into new prompts. When starting a new coding task, query the context API for relevant past sessions and include the results in your system prompt.Knowledge retrieval
Find how you solved a specific problem before. Semantic search is especially useful here because you can describe the problem in your own words.Team documentation
If your team shares an OpenSync instance (via self-hosting), search becomes a shared knowledge base of all coding sessions across the team.Eval dataset curation
Use search to find sessions about specific topics, then mark them as eval-ready for export.Tips
- Be specific with full-text search. Use function names, library names, and error messages.
- Be descriptive with semantic search. Ask questions as if you were talking to a colleague.
- Combine search types. Start with semantic to find the general area, then use full-text to find exact matches.
- Use source filters alongside search to narrow results to a specific tool.