CODE INTELLIGENCE FOR AI AGENTS · 2026
Krolik gives
AI agents eyes
that grep never had.
Tree-sitter ASTs across 13 languages, an Apache AGE knowledge graph,
and a live observability bridge from Prometheus alert to
file:function in 5 seconds. Thirty MCP tools.
Open source.
- Languages
- 13
- MCP tools
- 30+
- Install
- 5 min
KNOWLEDGE GRAPH
What Krolik sees.
Your code as a property graph, indexed for agents. Every symbol, every call edge, every import, every test relationship. Queried in natural language via Cypher.
debug_investigate
From Prometheus alert
to file:function in 5 seconds.
Six-phase async pipeline: failure spikes, Jaeger failed traces, symbol resolution, callgraph walks upstream and downstream, log excerpts, LLM fusion. Returns ranked hypotheses with body excerpts. No one else does this.
semantic_search
Find by concept.
Not by keyword.
Hybrid retrieval: BM25F lexical scoring, pgvector 768-dim embeddings, one-hop AGE graph expansion, ColBERT cross-encoder reranker. Finds what grep can't describe.
- auth.ValidateToken auth/token.go:142 ctx.Deadline() exceeded before JWKS fetch completed — timeout not propagated
- middleware.AuthChain auth/middleware.go:88 calls ValidateToken without context timeout guard
- jwks.FetchPublicKey auth/jwks.go:61 HTTP client uses default transport, no deadline
- server.handleAuth server/routes.go:207 auth handler called with request context
- TestValidateToken_Timeout auth/token_test.go:89 test exists but uses 30s timeout — too lenient
- config.AuthTimeout config/auth.go:34 timeout constant: 0 — not set
- cache.TokenStore cache/tokens.go:19 in-memory LRU, TTL-bound
- errors.ErrAuthFailed errors/auth.go:8 sentinel error used in 4 callers
- retry.WithBackoff retry/retry.go:44 exponential backoff, used by JWKS fetcher
- otel.RecordError telemetry/spans.go:91 helper for span error annotation
code_graph
Cypher via
natural language.
Apache AGE property graph on PostgreSQL. Every symbol, call edge, import, route handler, test relationship. Query the graph from plain English: Krolik translates to Cypher and returns structured results.
MATCH (caller:Symbol)-[:CALLS]->(fn:Symbol)
WHERE fn.name = 'ValidateToken'
AND fn.package = 'auth'
OPTIONAL MATCH (fn)-[:TESTED_BY]->(test:Symbol)
RETURN caller.name,
caller.file,
caller.line,
test.name AS test_coverage
ORDER BY caller.file; dataflow_analyze + rewrite
Taint tracking.
Structural codemods.
IL/CFG analysis traces values from source to sink. Detects dead stores, unescaped user input reaching SQL or command execution. Rewrite applies AST search-replace patterns across all 13 languages with wildcard matching, survives multi-line code that regex can't touch.
return errors.New(msg)
return fmt.Errorf("%s: %w", msg, err)
return nil, errors.New(queryErr)
return nil, fmt.Errorf("query: %w", queryErr)
return errors.New(cacheErr)
return fmt.Errorf("cache: %w", cacheErr)
... +244 more errors.New($MSG) → fmt.Errorf("%s: %w", $MSG, err) positioning
Where the tools live.
grep sees text. LSP sees one file's types. Sourcegraph indexes repos for humans. Datadog sees runtime metrics. Krolik sees all four layers simultaneously, for agents. No one else is in that quadrant.
quickstart
Five minutes from clone
to first MCP call.
$ docker compose -f krolik.yml up -d
Starting go-code ... done
$ curl -X POST http://localhost:8897/mcp \
-H 'Content-Type: application/json' \
-d '{"tool":"semantic_search","query":"auth context deadline bug"}'
→ 12 results in 380ms Requires: PostgreSQL with Apache AGE + pgvector, embed-server (Jina Code v2), OpenAI-compatible LLM proxy. Full quickstart on GitHub
FAQ
Frequently asked questions
What languages does Krolik support?
Go, Python, TypeScript, TSX, Rust, Java, C, C++, Ruby, C#, PHP, Svelte, and Astro — 13 total. Type-aware analysis is live today on Go via go/types. SCIP backend is in flight for the other 11.
How does it integrate with Claude Code or Cursor?
Krolik exposes 30 MCP tools over Streamable HTTP. Add the URL to your MCP config — Claude Code, Cursor, Windsurf, Aider, Cline, or any client implementing the Model Context Protocol.
How is this different from Sourcegraph?
Sourcegraph indexes code for humans. Krolik indexes code for AI agents. We add a knowledge graph (Apache AGE), a runtime observability bridge (Prometheus + Jaeger → file:function), and an MCP-native protocol. Sourcegraph has none of these.
Self-hosted only?
Yes. Open source. Bring your own PostgreSQL (with AGE + pgvector), embed-server, and OpenAI-compatible LLM proxy.
What's the licence?
Apache 2.0. Engine source: github.com/anatolykoptev/go-code.