Semantic search requires the project to be indexed. CodeFire automatically indexes projects in the background when they are opened.
context_search
Perform semantic code search across the current project. Finds functions, classes, documentation, and git history matching a natural language query using hybrid vector similarity and keyword search.Natural language description of what you’re looking for in the codebase
Maximum results to return (default: 10, max: 30)
Filter by chunk type. Available types:
function, class, block, doc, commitOmit to search all types.Unique chunk identifier
Chunk type:
function, class, block, doc, or commitRelative path to the file containing this chunk
Starting line number in the file
Ending line number in the file
The actual code or text content
Function or class name if applicable
Function signature or class declaration
Relevance score (higher is better)
How Semantic Search Works
CodeFire’s semantic search uses a hybrid approach:- Vector Embeddings: Code is embedded using OpenAI’s text-embedding-3-small model
- Keyword Matching: Traditional full-text search for exact matches
- Hybrid Ranking: Results are ranked by combining similarity scores and keyword relevance
Indexed Content
CodeFire indexes:- Functions: Function definitions and their bodies
- Classes: Class declarations and methods
- Blocks: Significant code blocks (loops, conditionals, etc.)
- Documentation: Comments, docstrings, README files, markdown docs
- Commits: Git commit messages and diffs
Best Practices
Use natural language queries
Use natural language queries
Instead of: “JWT auth middleware”Try: “middleware that checks if the user is authenticated using JWT tokens”
Be specific about context
Be specific about context
Instead of: “database query”Try: “function that queries the users table to find users by email address”
Filter by type when appropriate
Filter by type when appropriate
If you’re looking for a specific function, use
types: ["function"] to exclude classes and documentation.Iterate on queries
Iterate on queries
If results aren’t relevant, rephrase your query with more context or different terminology.
Notes
- Requires project indexing (automatic when project is opened)
- Uses OpenAI embeddings via OpenRouter API
- Search is project-scoped (searches current project only)
- Index updates incrementally as files change
- Large projects may take several minutes to index initially
MCP Integration
Learn how to use semantic search in AI workflows
Project Management
How CodeFire manages and indexes projects
