Semantic Indexing
Does opencode use semantic indexing of the codebase like kilo or cursor?
No. The current Opencode agents work off direct filesystem reads and standard text search (e.g., ripgrep) inside the workspace. There’s no vector store or persistent semantic index like Kilo or Cursor provide
it actually possible with external MCP to index the codebase
it actually possible with external MCP to index the codebase
Yes, it is definitely possible! I'm very interested in this approach. Could you please recommend any specific projects or tools that are good for getting started with codebase indexing using external MCP?
I recently came across this project, but I haven’t had a chance to try it out yet.
Oh, thank you very much! I was extremely busy with work recently and didn’t pay much attention to my email. Today, I tried grepai on a company project, and the results were excellent—it can precisely locate business logic code using natural language.
No. The current Opencode agents work off direct filesystem reads and standard text search (e.g., ripgrep) inside the workspace. There’s no vector store or persistent semantic index like Kilo or Cursor provide
@thdxr @rekram1-node Can we now get semantic knowledge for agents? As now we have sqlite already so it is possible using "sqlite-vec" extension to also do vector embeddings. (Openclaw also does something like this currently)
Hehe I have something cooking
Since someone mentioned sqlite-vec is now an option with the SQLite integration, I can confirm this approach works extremely well for code search. I built a semantic search plugin that uses exactly this stack: sqlite-vec for vector storage, FTS5 for keyword indexing, embeddings via Ollama locally.
The key insight that made it work well for code specifically: pure vector search alone gives you maybe 85% accuracy because it misses exact function names and imports. Adding BM25 keyword matching and a separate identifier boosting pass pushes that to around 98% in my benchmarks. The three scores get blended with configurable weights.
For chunking I do a simpler approach than tree-sitter: fixed size chunks with overlap, but each chunk carries metadata about which file and line range it covers. Works surprisingly well and avoids the complexity of maintaining tree-sitter grammars for every language.
Storage is a single SQLite file with two virtual tables: one sqlite-vec for embeddings, one FTS5 for keywords. Queries hit both and merge results. Fast enough that search feels instant even on 100k+ line codebases.
The whole thing runs with Ollama using nomic-embed-text or mxbai-embed-large. No cloud dependency.
Implementation here if useful as reference: https://github.com/sagarmk/beacon-plugin
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.
Would be great if added