Code Intelligence
Code-aware indexing, search, symbols, deps, and graph workflows introduced in the v0.18 series
Code Intelligence
Knowns includes a code-awareness layer so agents can reason from real files and symbols instead of guessing from task and doc text alone.
What It Provides
- AST-based indexing for supported source files
- Dedicated code workflows for ingesting, watching, searching, and inspecting dependencies
- Code-aware graph exploration in the Web UI
- MCP code tools for structured agent retrieval
- Structural knowledge retrieval (v0.20) — relation-aware traversal across entities and graph edges
This feature is opt-in. If you never index code, your existing task/doc/memory workflows keep working normally.
Core Flow
# Build the initial code index
knowns code ingest
# Keep code index fresh while you work
knowns code watch
# Discover likely entry points
knowns code search "oauth login"
# Inspect indexed symbols in a scope
knowns code symbols
# Inspect raw code relationships
knowns code deps
Recommended Retrieval Order
When you need code context, use this order:
knowns code searchfor entry-point discoveryknowns code symbolsto verify what was indexed in a file or scopeknowns code depsto inspect raw relationships
That order matches the imported learnings for the v0.18 code graph work: search is best for discovery, symbols verify parser/index output, and deps confirm relationships.
What Gets Indexed
The imported AST Code Intelligence spec describes these capabilities:
- Functions, methods, classes, interfaces, and file-level entries can become code chunks
- Relationship edges such as calls, imports, and contains are stored for later graph and dependency exploration
- Supported languages include Go, TypeScript, JavaScript, and Python
- Browser watch mode can keep the UI server and file watching in the same workflow
Web UI Support
The v0.18.0 release also introduced a dedicated Code Graph experience in the Web UI:
- Show or hide code nodes separately from tasks, docs, and memories
- Explore code-connected project context visually
- Use graph details and relationships to jump from knowledge to implementation
For the browser workflow, see Web UI.
MCP Tools
Agents can use the code-aware MCP tools directly (v0.20 consolidated format):
// Search for code symbols
code({ action: "search", query: "oauth login" })
// Inspect symbols in a file or scope
code({ action: "symbols", path: "src/auth/" })
// Inspect dependency edges
code({ action: "deps", type: "imports" })
// Get graph data for exploration
code({ action: "graph" })
These are a better fit for machine-readable code exploration than trying to force code results into generic text search.
Related
- MCP Integration - structured tools for code-aware agent workflows
- Web UI - code graph, workspace switching, and richer chat UI
- Semantic Search - search and retrieval behavior across docs, tasks, and memory
Code Intelligence
Knowns bao gồm code-awareness layer để agents có thể suy luận từ files và symbols thực thay vì đoán từ task và doc text.
Cung cấp gì
- AST-based indexing cho source files được hỗ trợ
- Dedicated code workflows cho ingesting, watching, searching, và inspecting dependencies
- Code-aware graph exploration trong Web UI
- MCP code tools cho structured agent retrieval
- Structural knowledge retrieval (v0.20) — relation-aware traversal across entities và graph edges
Tính năng này là opt-in. Nếu bạn không index code, các task/doc/memory workflows hiện tại vẫn hoạt động bình thường.
Core Flow
# Build code index ban đầu
knowns code ingest
# Giữ code index fresh khi làm việc
knowns code watch
# Tìm entry points
knowns code search "oauth login"
# Kiểm tra indexed symbols trong scope
knowns code symbols
# Kiểm tra raw code relationships
knowns code deps
Thứ tự Retrieval khuyến nghị
Khi cần code context, dùng thứ tự này:
knowns code searchcho entry-point discoveryknowns code symbolsđể verify những gì đã indexed trong file hoặc scopeknowns code depsđể kiểm tra relationships
Những gì được Index
- Functions, methods, classes, interfaces, và file-level entries có thể trở thành code chunks
- Relationship edges như calls, imports, và contains được lưu cho graph và dependency exploration
- Ngôn ngữ hỗ trợ: Go, TypeScript, JavaScript, và Python
- Browser watch mode giữ UI server và file watching trong cùng workflow
Web UI Support
Code Graph experience trong Web UI:
- Hiển thị hoặc ẩn code nodes riêng biệt với tasks, docs, và memories
- Explore code-connected project context trực quan
- Dùng graph details và relationships để nhảy từ knowledge sang implementation
Xem Web UI cho browser workflow.
MCP Tools
Agents có thể dùng code-aware MCP tools trực tiếp (v0.20 consolidated format):
// Search code symbols
code({ action: "search", query: "oauth login" })
// Kiểm tra symbols trong file hoặc scope
code({ action: "symbols", path: "src/auth/" })
// Kiểm tra dependency edges
code({ action: "deps", type: "imports" })
// Lấy graph data để exploration
code({ action: "graph" })
Liên quan
- MCP Integration - structured tools cho code-aware agent workflows
- Web UI - code graph, workspace switching, và richer chat UI
- Semantic Search - search và retrieval across docs, tasks, và memory