wia-agent 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. wia_agent-0.3.0/MANIFEST.in +10 -0
  2. wia_agent-0.3.0/PKG-INFO +515 -0
  3. wia_agent-0.3.0/README.md +464 -0
  4. wia_agent-0.3.0/backend/app/__init__.py +6 -0
  5. wia_agent-0.3.0/backend/app/agent/__init__.py +3 -0
  6. wia_agent-0.3.0/backend/app/agent/nooa_agent.py +230 -0
  7. wia_agent-0.3.0/backend/app/api/__init__.py +3 -0
  8. wia_agent-0.3.0/backend/app/api/router.py +431 -0
  9. wia_agent-0.3.0/backend/app/cli.py +642 -0
  10. wia_agent-0.3.0/backend/app/core/__init__.py +1 -0
  11. wia_agent-0.3.0/backend/app/core/config.py +42 -0
  12. wia_agent-0.3.0/backend/app/core/database.py +36 -0
  13. wia_agent-0.3.0/backend/app/core/llm.py +78 -0
  14. wia_agent-0.3.0/backend/app/main.py +58 -0
  15. wia_agent-0.3.0/backend/app/models/__init__.py +3 -0
  16. wia_agent-0.3.0/backend/app/models/knowledge.py +84 -0
  17. wia_agent-0.3.0/backend/app/models/workspace.py +73 -0
  18. wia_agent-0.3.0/backend/app/providers/__init__.py +4 -0
  19. wia_agent-0.3.0/backend/app/providers/base.py +15 -0
  20. wia_agent-0.3.0/backend/app/providers/nvidia_nim.py +70 -0
  21. wia_agent-0.3.0/backend/app/services/export/okf_exporter.py +150 -0
  22. wia_agent-0.3.0/backend/app/services/graph/code_graph.py +327 -0
  23. wia_agent-0.3.0/backend/app/services/ingestion/__init__.py +3 -0
  24. wia_agent-0.3.0/backend/app/services/ingestion/crawler.py +194 -0
  25. wia_agent-0.3.0/backend/app/services/intelligence/endpoint_detector.py +95 -0
  26. wia_agent-0.3.0/backend/app/services/intelligence/git_intel.py +76 -0
  27. wia_agent-0.3.0/backend/app/services/intelligence/incremental_indexer.py +49 -0
  28. wia_agent-0.3.0/backend/app/services/intelligence/secret_safety.py +44 -0
  29. wia_agent-0.3.0/backend/app/services/parser/__init__.py +3 -0
  30. wia_agent-0.3.0/backend/app/services/parser/ast_parser.py +52 -0
  31. wia_agent-0.3.0/backend/app/services/parser/base.py +17 -0
  32. wia_agent-0.3.0/backend/app/services/parser/plugins/__init__.py +12 -0
  33. wia_agent-0.3.0/backend/app/services/parser/plugins/c_family_parser.py +92 -0
  34. wia_agent-0.3.0/backend/app/services/parser/plugins/go_parser.py +64 -0
  35. wia_agent-0.3.0/backend/app/services/parser/plugins/python_parser.py +98 -0
  36. wia_agent-0.3.0/backend/app/services/parser/plugins/typescript_parser.py +78 -0
  37. wia_agent-0.3.0/backend/app/services/pipeline.py +126 -0
  38. wia_agent-0.3.0/backend/app/services/rag/__init__.py +3 -0
  39. wia_agent-0.3.0/backend/app/services/rag/vector_store.py +128 -0
  40. wia_agent-0.3.0/backend/app/services/retrieval/context_builder.py +51 -0
  41. wia_agent-0.3.0/backend/app/services/retrieval/hybrid_retriever.py +98 -0
  42. wia_agent-0.3.0/backend/app/services/retrieval/query_planner.py +73 -0
  43. wia_agent-0.3.0/backend/app/services/summarizer/__init__.py +3 -0
  44. wia_agent-0.3.0/backend/app/services/summarizer/hierarchical.py +122 -0
  45. wia_agent-0.3.0/backend/wia_agent.egg-info/PKG-INFO +515 -0
  46. wia_agent-0.3.0/backend/wia_agent.egg-info/SOURCES.txt +50 -0
  47. wia_agent-0.3.0/backend/wia_agent.egg-info/dependency_links.txt +1 -0
  48. wia_agent-0.3.0/backend/wia_agent.egg-info/entry_points.txt +2 -0
  49. wia_agent-0.3.0/backend/wia_agent.egg-info/requires.txt +30 -0
  50. wia_agent-0.3.0/backend/wia_agent.egg-info/top_level.txt +1 -0
  51. wia_agent-0.3.0/pyproject.toml +94 -0
  52. wia_agent-0.3.0/setup.cfg +4 -0
@@ -0,0 +1,10 @@
1
+ include README.md
2
+ recursive-include backend/app *.py
3
+ recursive-exclude backend/data *
4
+ recursive-exclude backend/tests *
5
+ recursive-exclude tests *
6
+ recursive-exclude data *
7
+ recursive-exclude frontend *
8
+ recursive-exclude vscode-extension *
9
+ recursive-exclude .pytest_cache *
10
+ global-exclude *.py[cod] __pycache__ *.so .DS_Store .env .env.* *.db *.sqlite3
@@ -0,0 +1,515 @@
1
+ Metadata-Version: 2.4
2
+ Name: wia-agent
3
+ Version: 0.3.0
4
+ Summary: Workspace Intelligence Agent (WIA) โ€” Graph-grounded workspace intelligence platform for code understanding, AST parsing, flow tracing, and RAG Q&A
5
+ Author-email: WIA Architecture Team <architect@wia-agent.dev>
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/WIA-Agent/workspace-intelligence-agent
8
+ Project-URL: Documentation, https://github.com/WIA-Agent/workspace-intelligence-agent#readme
9
+ Project-URL: Repository, https://github.com/WIA-Agent/workspace-intelligence-agent
10
+ Project-URL: Issues, https://github.com/WIA-Agent/workspace-intelligence-agent/issues
11
+ Keywords: codebase-intelligence,workspace-intelligence,ast-parser,knowledge-graph,nvidia-nim,hybrid-retrieval,code-rag,flow-tracing,impact-analysis,developer-onboarding
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
22
+ Requires-Python: >=3.10
23
+ Description-Content-Type: text/markdown
24
+ Requires-Dist: fastapi>=0.100.0
25
+ Requires-Dist: uvicorn>=0.23.0
26
+ Requires-Dist: pydantic>=2.0.0
27
+ Requires-Dist: pydantic-settings>=2.0.0
28
+ Requires-Dist: sqlmodel>=0.0.16
29
+ Requires-Dist: sqlalchemy>=2.0.0
30
+ Requires-Dist: GitPython>=3.1.0
31
+ Requires-Dist: tree-sitter>=0.21.0
32
+ Requires-Dist: sentence-transformers>=2.2.0
33
+ Requires-Dist: numpy>=1.24.0
34
+ Requires-Dist: httpx>=0.24.0
35
+ Requires-Dist: python-multipart>=0.0.6
36
+ Requires-Dist: openai>=1.0.0
37
+ Requires-Dist: rich>=13.0.0
38
+ Requires-Dist: networkx>=3.0
39
+ Requires-Dist: typer>=0.9.0
40
+ Provides-Extra: dev
41
+ Requires-Dist: pytest>=8.0.0; extra == "dev"
42
+ Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
43
+ Requires-Dist: build>=1.0.0; extra == "dev"
44
+ Requires-Dist: twine>=4.0.0; extra == "dev"
45
+ Provides-Extra: ai
46
+ Requires-Dist: openai>=1.0.0; extra == "ai"
47
+ Requires-Dist: anthropic>=0.18.0; extra == "ai"
48
+ Requires-Dist: google-genai>=0.1.0; extra == "ai"
49
+ Provides-Extra: postgres
50
+ Requires-Dist: psycopg2-binary>=2.9.0; extra == "postgres"
51
+
52
+ # ๐Ÿง  Workspace Intelligence Agent (WIA)
53
+
54
+ [![Python](https://img.shields.io/badge/Python-3.10%2B-blue.svg)](https://www.python.org/)
55
+ [![Package](https://img.shields.io/badge/PyPI-wia--agent-orange.svg)](https://pypi.org/project/wia-agent/)
56
+ [![FastAPI](https://img.shields.io/badge/FastAPI-0.100%2B-009688.svg)](https://fastapi.tiangolo.com/)
57
+ [![VS Code Extension](https://img.shields.io/badge/VS_Code_Extension-Ready-007ACC.svg)](https://code.visualstudio.com/)
58
+ [![Tests](https://img.shields.io/badge/Tests-26%20Passed-brightgreen.svg)](https://pytest.org/)
59
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
60
+
61
+ **Workspace Intelligence Agent (WIA)** is an enterprise-grade, graph-grounded workspace intelligence platform that builds a structured understanding of an entire software repository. It uses that knowledge to answer questions, explain architecture, trace execution flow, analyze dependency impact, onboard developers, and provide grounded AI reasoning with exact file and line citations.
62
+
63
+ WIA is distributed on PyPI as **`wia-agent`** providing the **`wia`** CLI tool, paired with a **Native VS Code Extension**.
64
+
65
+ ---
66
+
67
+ ## ๐Ÿ“‘ Table of Contents
68
+
69
+ 1. [๐Ÿ— System Architecture & End-to-End Pipeline](#1-๐Ÿ—-system-architecture--end-to-end-pipeline)
70
+ 2. [โšก Complete Technology Stack](#2-โšก-complete-technology-stack)
71
+ 3. [๐Ÿ“ Repository Directory Structure](#3-๐Ÿ“-repository-directory-structure)
72
+ 4. [๐Ÿ’ป Exhaustive Command-Line Interface (CLI) Manual](#4-๐Ÿ’ป-exhaustive-command-line-interface-cli-manual)
73
+ 5. [๐Ÿงฉ Native VS Code Extension Guide](#5-๐Ÿงฉ-native-vs-code-extension-guide)
74
+ 6. [๐Ÿš€ Quickstart & Installation Guide](#6-๐Ÿš€-quickstart--installation-guide)
75
+ - [PyPI Installation](#pypi-installation)
76
+ - [Local Development Setup](#local-development-setup)
77
+ - [Running via WIA Engine Daemon](#running-via-wia-engine-daemon)
78
+ - [Docker Compose Deployment](#docker-compose-deployment)
79
+ 7. [๐Ÿ“ก Complete REST API Reference](#7-๐Ÿ“ก-complete-rest-api-reference)
80
+ 8. [๐Ÿง  Workspace Knowledge Model & Code Knowledge Graph](#8-๐Ÿง -workspace-knowledge-model--code-knowledge-graph)
81
+ 9. [๐Ÿ”Œ Multi-Language AST Parser Plugin Architecture](#9-๐Ÿ”Œ-multi-language-ast-parser-plugin-architecture)
82
+ 10. [๐Ÿ“Š 5-Level Hierarchical Workspace Summarization Engine](#10-๐Ÿ“Š-5-level-hierarchical-workspace-summarization-engine)
83
+ 11. [๐Ÿ” Hybrid Retrieval Engine & Query Planner](#11-๐Ÿ”-hybrid-retrieval-engine--query-planner)
84
+ 12. [๐Ÿค– NVIDIA NIM AI Reasoning Provider](#12-๐Ÿค–-nvidia-nim-ai-reasoning-provider)
85
+ 13. [๐Ÿ›ก๏ธ Provenance & Secret Safety Redaction](#13-๐Ÿ›ก๏ธ-provenance--secret-safety-redaction)
86
+ 14. [๐Ÿ“ฆ Open Knowledge Format (OKF) Export](#14-๐Ÿ“ฆ-open-knowledge-format-okf-export)
87
+ 15. [โš™๏ธ Complete Configuration & Environment Variables (`.env`)](#15-โš™๏ธ-complete-configuration--environment-variables-env)
88
+ 16. [๐Ÿงช Automated Testing Suite](#16-๐Ÿงช-automated-testing-suite)
89
+ 17. [โ“ Troubleshooting & FAQ](#17-โ“-troubleshooting--faq)
90
+ 18. [๐Ÿ“š Documentation Index](#18-๐Ÿ“š-documentation-index)
91
+ 19. [๐Ÿ“„ License](#19-๐Ÿ“„-license)
92
+
93
+ ---
94
+
95
+ ## 1. ๐Ÿ— System Architecture & End-to-End Pipeline
96
+
97
+ ```
98
+ GitHub Repository URL or Local Workspace Directory
99
+ โ”‚
100
+ โ–ผ
101
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
102
+ โ”‚ 1. Repository Ingestion, Safety & Incremental Change Detector โ”‚
103
+ โ”‚ โ€ข Recursively scans filesystem or clones Git repository โ”‚
104
+ โ”‚ โ€ข Filters noise (.git, node_modules, .venv, build, binaries) โ”‚
105
+ โ”‚ โ€ข SHA256 file hashing for incremental change detection โ”‚
106
+ โ”‚ โ€ข Automatically ignores .env/keys and redacts credentials โ”‚
107
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
108
+ โ”‚
109
+ โ–ผ
110
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
111
+ โ”‚ 2. Extensible Multi-Language Parser Plugin System โ”‚
112
+ โ”‚ โ€ข Python AST (classes, async functions, docstrings, calls) โ”‚
113
+ โ”‚ โ€ข TypeScript / JavaScript (classes, interfaces, arrow fns) โ”‚
114
+ โ”‚ โ€ข Go (structs, interfaces, method receivers, package imports) โ”‚
115
+ โ”‚ โ€ข Rust (structs, enums, traits, pub fn extractors) โ”‚
116
+ โ”‚ โ€ข C / C++ / Java / C# (classes, interfaces, method signatures)โ”‚
117
+ โ”‚ โ€ข Automated API route & unit test case discovery โ”‚
118
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
119
+ โ”‚
120
+ โ–ผ
121
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
122
+ โ”‚ 3. Workspace Knowledge Model & Code Knowledge Graph โ”‚
123
+ โ”‚ โ€ข Entities: Repository, Subsystem, File, Symbol, Function โ”‚
124
+ โ”‚ โ€ข Relational Edges: CONTAINS, DEFINES, IMPORTS, CALLS, INHERITโ”‚
125
+ โ”‚ โ€ข Strict Provenance: DETERMINISTIC_FACT vs LLM_SUMMARY โ”‚
126
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
127
+ โ”‚
128
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
129
+ โ–ผ โ–ผ โ–ผ
130
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
131
+ โ”‚ 4A. Hierarchical โ”‚ โ”‚ 4B. Hybrid Vector โ”‚ โ”‚ 4C. Portable OKF โ”‚
132
+ โ”‚ Summaries โ”‚ โ”‚ & Lexical RAG โ”‚ โ”‚ Knowledge โ”‚
133
+ โ”‚ (5 Levels) โ”‚ โ”‚ Embeddings โ”‚ โ”‚ Export โ”‚
134
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
135
+ โ”‚ โ”‚ โ”‚
136
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
137
+ โ”‚
138
+ โ–ผ
139
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
140
+ โ”‚ 5. Hybrid Retrieval Engine & Query Planner โ”‚
141
+ โ”‚ โ€ข Combines Symbol Lookup + Lexical BM25 + Vector + Graph Walks โ”‚
142
+ โ”‚ โ€ข Intent Planner: Architecture, Flow, Impact, Onboard, Health โ”‚
143
+ โ”‚ โ€ข Structured Context Builder with Line-Number Citations โ”‚
144
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
145
+ โ”‚
146
+ โ–ผ
147
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
148
+ โ”‚ 6. NVIDIA NIM Reasoning Layer & Grounded Output โ”‚
149
+ โ”‚ โ€ข Grounded generation powered by NVIDIA NIM โ”‚
150
+ โ”‚ โ€ข Exact source file and line-number citations โ”‚
151
+ โ”‚ โ€ข Deterministic offline mode when NIM is not configured โ”‚
152
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
153
+ โ”‚
154
+ โ–ผ
155
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
156
+ โ”‚ CLI (`wia`) โ”‚ VS Code Extension โ”‚ REST API โ”‚
157
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
158
+ ```
159
+
160
+ ---
161
+
162
+ ## 2. โšก Complete Technology Stack
163
+
164
+ | Layer | Component | Implementation |
165
+ |---|---|---|
166
+ | **Language & Engine** | Python 3.10+ | FastAPI, Pydantic v2, SQLModel, Uvicorn |
167
+ | **CLI Framework** | Python CLI | `argparse` with UTF-8 console output |
168
+ | **Code Parsing** | Multi-Language Parser Plugins | `ast` (Python), Regex/Structural Extractors (TS/JS, Go, Rust, Java, C++, C#) |
169
+ | **Knowledge Graph** | NetworkX Graph Engine | Directed graph with SQLite / PostgreSQL persistence |
170
+ | **Hybrid Retrieval** | Hybrid Engine | Exact Symbol Index + BM25 Lexical + SentenceTransformers Vector + Graph BFS |
171
+ | **AI Reasoning** | NVIDIA NIM Provider | OpenAI-compatible NIM API (`meta/llama-3.1-70b-instruct`) |
172
+ | **IDE Extension** | VS Code Extension | TypeScript, VS Code Extension API, Webview Chat, TreeView Provider |
173
+ | **Knowledge Export** | Open Knowledge Format (OKF) | Deterministic `.wia/knowledge/` Markdown / YAML documentation |
174
+
175
+ ---
176
+
177
+ ## 3. ๐Ÿ“ Repository Directory Structure
178
+
179
+ ```
180
+ Workspace-Intelligence-Agent/
181
+ โ”œโ”€โ”€ backend/
182
+ โ”‚ โ”œโ”€โ”€ app/
183
+ โ”‚ โ”‚ โ”œโ”€โ”€ __init__.py # Package version definition (v0.3.0)
184
+ โ”‚ โ”‚ โ”œโ”€โ”€ cli.py # WIA CLI command implementations
185
+ โ”‚ โ”‚ โ”œโ”€โ”€ main.py # FastAPI application & lifespan management
186
+ โ”‚ โ”‚ โ”œโ”€โ”€ agent/ # WIA Code Understanding Agent
187
+ โ”‚ โ”‚ โ”œโ”€โ”€ api/ # REST API routers & Pydantic models
188
+ โ”‚ โ”‚ โ”œโ”€โ”€ core/ # Config, database engine, & LLM client
189
+ โ”‚ โ”‚ โ”œโ”€โ”€ models/ # SQLModel workspace & knowledge entities
190
+ โ”‚ โ”‚ โ”œโ”€โ”€ providers/ # NVIDIA NIM & base LLM providers
191
+ โ”‚ โ”‚ โ””โ”€โ”€ services/
192
+ โ”‚ โ”‚ โ”œโ”€โ”€ export/ # OKF exporter
193
+ โ”‚ โ”‚ โ”œโ”€โ”€ graph/ # Code knowledge graph & graph traversal
194
+ โ”‚ โ”‚ โ”œโ”€โ”€ ingestion/ # Crawler & file discovery
195
+ โ”‚ โ”‚ โ”œโ”€โ”€ intelligence/ # Git diff, watcher, secret safety
196
+ โ”‚ โ”‚ โ”œโ”€โ”€ parser/ # Multi-language parser plugins
197
+ โ”‚ โ”‚ โ”œโ”€โ”€ rag/ # VectorStore & embeddings
198
+ โ”‚ โ”‚ โ”œโ”€โ”€ retrieval/ # HybridRetriever, QueryPlanner, ContextBuilder
199
+ โ”‚ โ”‚ โ””โ”€โ”€ summarizer/ # 5-level hierarchical summarizer
200
+ โ”‚ โ””โ”€โ”€ tests/ # Pytest automated test suite (26 tests)
201
+ โ”œโ”€โ”€ docs/ # Detailed design & user documentation
202
+ โ”‚ โ”œโ”€โ”€ AI_ARCHITECTURE.md # NVIDIA NIM & Agent architecture
203
+ โ”‚ โ”œโ”€โ”€ API.md # Complete REST API reference
204
+ โ”‚ โ”œโ”€โ”€ ARCHITECTURE.md # System design & component breakdown
205
+ โ”‚ โ”œโ”€โ”€ CLI.md # CLI reference manual
206
+ โ”‚ โ”œโ”€โ”€ HIERARCHICAL_SUMMARIZATION.md # 5-level summarization engine
207
+ โ”‚ โ”œโ”€โ”€ KNOWLEDGE_MODEL.md # Graph entities & relation schema
208
+ โ”‚ โ”œโ”€โ”€ OKF_EXPORT.md # Open Knowledge Format guide
209
+ โ”‚ โ”œโ”€โ”€ PACKAGING.md # PyPI packaging & distribution guide
210
+ โ”‚ โ”œโ”€โ”€ PROVENANCE.md # Deterministic fact vs summary model
211
+ โ”‚ โ”œโ”€โ”€ RETRIEVAL.md # Hybrid retrieval pipeline
212
+ โ”‚ โ””โ”€โ”€ VSCODE_EXTENSION.md # VS Code extension architecture
213
+ โ”œโ”€โ”€ vscode-extension/ # Native VS Code Extension (TypeScript)
214
+ โ”‚ โ”œโ”€โ”€ package.json
215
+ โ”‚ โ”œโ”€โ”€ src/
216
+ โ”‚ โ”‚ โ”œโ”€โ”€ extension.ts # Extension activation & commands
217
+ โ”‚ โ”‚ โ”œโ”€โ”€ api.ts # WIA Backend API client
218
+ โ”‚ โ”‚ โ”œโ”€โ”€ chatViewProvider.ts # Interactive AI chat webview
219
+ โ”‚ โ”‚ โ””โ”€โ”€ treeViews.ts # Architecture, Symbols, & Dependency trees
220
+ โ”œโ”€โ”€ docker-compose.yml # Docker Compose with PostgreSQL support
221
+ โ”œโ”€โ”€ Dockerfile.backend # Backend container definition
222
+ โ”œโ”€โ”€ pyproject.toml # PEP 517/621 packaging metadata
223
+ โ”œโ”€โ”€ .env.example # Documented environment variables template
224
+ โ””โ”€โ”€ README.md
225
+ ```
226
+
227
+ ---
228
+
229
+ ## 4. ๐Ÿ’ป Exhaustive Command-Line Interface (CLI) Manual
230
+
231
+ ```bash
232
+ # Display CLI help and command index
233
+ wia --help
234
+ ```
235
+
236
+ ### Complete CLI Command Reference
237
+
238
+ | Command | Syntax | Description | Example |
239
+ |---|---|---|---|
240
+ | **`scan`** | `wia scan <path_or_url> [--name <name>]` | Ingest and analyze a codebase | `wia scan ./ --name "My App"` |
241
+ | **`query`** | `wia query <repo> "<question>"` | Ask AI technical questions with exact line citations | `wia query "My App" "Explain auth flow"` |
242
+ | **`architecture`** | `wia architecture <repo>` | View graph nodes/edges and subsystem breakdown | `wia architecture "My App"` |
243
+ | **`flow`** | `wia flow <repo> <symbol>` | Trace call execution flow starting from an entry symbol | `wia flow "My App" handle_login` |
244
+ | **`impact`** | `wia impact <repo> <symbol>` | Analyze ripple change impact on callers and files | `wia impact "My App" AuthService` |
245
+ | **`diff`** | `wia diff [<repo>]` | Analyze Git diff changes and affected symbols | `wia diff "My App"` |
246
+ | **`watch`** | `wia watch <path_or_repo> [--interval 3]` | Watch workspace and incrementally reindex on change | `wia watch ./` |
247
+ | **`health`** | `wia health <repo>` | Run codebase complexity and health audit | `wia health "My App"` |
248
+ | **`onboard`** | `wia onboard <repo>` | Generate developer onboarding walkthrough | `wia onboard "My App"` |
249
+ | **`symbols`** | `wia symbols <repo> [--search <term>]` | Search and list AST symbols across the codebase | `wia symbols "My App" --search login` |
250
+ | **`dependencies`**| `wia dependencies <repo>` | Inspect package manifests and cross-file import statements | `wia dependencies "My App"` |
251
+ | **`parse`** | `wia parse <file>` | Extract AST classes, functions, and imports from a single file | `wia parse backend/app/main.py` |
252
+ | **`summarize`** | `wia summarize <repo>` | View the 5-level hierarchical summaries | `wia summarize "My App"` |
253
+ | **`export`** | `wia export <repo> --format [markdown\|json\|okf]` | Export architecture report or Open Knowledge Format | `wia export "My App" --format okf` |
254
+ | **`list`** | `wia list` | List all ingested repositories | `wia list` |
255
+ | **`delete`** | `wia delete <repo>` | Delete repository and purge all cached knowledge | `wia delete "My App"` |
256
+ | **`serve`** | `wia serve [--port 8000]` | Start local FastAPI daemon server for VS Code | `wia serve --port 8000` |
257
+ | **`test`** | `wia test` | Run the automated test suite | `wia test` |
258
+
259
+ ---
260
+
261
+ ## 5. ๐Ÿงฉ Native VS Code Extension Guide
262
+
263
+ The **WIA VS Code Extension** embeds graph-grounded code intelligence directly into your editor:
264
+
265
+ ### Key Features
266
+ 1. **๐Ÿ›๏ธ Architecture TreeView**: Browse subsystems, root folders, and architectural components.
267
+ 2. **๐Ÿ” AST Symbol Explorer**: Navigate all functions, classes, interfaces, and methods in the workspace.
268
+ 3. **๐Ÿ“ฆ Dependencies & Imports**: Inspect package manifests and import statements.
269
+ 4. **๐Ÿง  Interactive AI Chat**: Natural-language codebase Q&A with **clickable source citations** that jump directly to exact file line ranges in the VS Code editor.
270
+ 5. **โšก Editor Context Menu Actions**:
271
+ - `WIA: Explain Code Architecture`
272
+ - `WIA: Trace Code Execution Flow`
273
+ - `WIA: Analyze Change Impact`
274
+ - `WIA: Export Open Knowledge Format (.wia/knowledge/)`
275
+
276
+ ---
277
+
278
+ ## 6. ๐Ÿš€ Quickstart & Installation Guide
279
+
280
+ ### PyPI Installation
281
+ ```bash
282
+ # Install WIA distribution from PyPI
283
+ pip install wia-agent
284
+
285
+ # Verify CLI
286
+ wia --help
287
+ ```
288
+
289
+ ### Local Development Setup
290
+ ```bash
291
+ # 1. Clone repository
292
+ git clone https://github.com/Yashwanth112004/Workspace-Intelligence-Agent.git
293
+ cd Workspace-Intelligence-Agent
294
+
295
+ # 2. Install package in editable development mode with dev tools
296
+ pip install -e ".[dev]"
297
+
298
+ # 3. Configure environment variables
299
+ cp .env.example .env
300
+ ```
301
+
302
+ ### Running via WIA Engine Daemon
303
+ ```bash
304
+ # Start the local daemon for CLI and VS Code extension
305
+ wia serve
306
+ ```
307
+
308
+ ### Docker Compose Deployment
309
+ ```bash
310
+ # Run backend engine with PostgreSQL
311
+ docker-compose up --build
312
+ ```
313
+
314
+ ---
315
+
316
+ ## 7. ๐Ÿ“ก Complete REST API Reference
317
+
318
+ Base URL: `http://127.0.0.1:8000/api/v1`
319
+
320
+ | Method | Endpoint | Description |
321
+ |---|---|---|
322
+ | `POST` | `/api/v1/ingest` | Ingest repository (GitHub URL or local path) |
323
+ | `GET` | `/api/v1/repos` | List all ingested repositories |
324
+ | `GET` | `/api/v1/repos/{repo_id}/status` | Get analysis progress status and metadata |
325
+ | `GET` | `/api/v1/repos/{repo_id}/tree` | Get repository file and folder hierarchy |
326
+ | `GET` | `/api/v1/repos/{repo_id}/file?path={rel_path}` | Get file content, AST symbols, and file summary |
327
+ | `GET` | `/api/v1/repos/{repo_id}/symbols` | Search and filter AST symbols |
328
+ | `GET` | `/api/v1/repos/{repo_id}/dependencies` | Get package manifests and module imports |
329
+ | `GET` | `/api/v1/repos/{repo_id}/graph` | Get interactive Code Knowledge Graph JSON |
330
+ | `GET` | `/api/v1/repos/{repo_id}/flow?entry={symbol}` | Trace execution call paths |
331
+ | `GET` | `/api/v1/repos/{repo_id}/impact?symbol={symbol}` | Compute dependency change blast radius |
332
+ | `GET` | `/api/v1/repos/{repo_id}/onboard` | Generate developer onboarding walkthrough |
333
+ | `GET` | `/api/v1/repos/{repo_id}/health` | Run codebase complexity and health audit |
334
+ | `GET` | `/api/v1/repos/{repo_id}/summaries` | Retrieve 5-level hierarchical summaries |
335
+ | `GET` | `/api/v1/repos/{repo_id}/export?format={okf\|markdown}` | Export knowledge or Open Knowledge Format |
336
+ | `POST` | `/api/v1/repos/{repo_id}/query` | Ask AI technical questions with exact source citations |
337
+ | `DELETE` | `/api/v1/repos/{repo_id}` | Purge repository from database and storage |
338
+
339
+ ---
340
+
341
+ ## 8. ๐Ÿง  Workspace Knowledge Model & Code Knowledge Graph
342
+
343
+ WIA structures repository understanding into first-class typed entities:
344
+ - **`Repository`**: Top-level workspace metadata, entry points, dependencies.
345
+ - **`FileNode`**: File/directory structure with language classification and SHA256 hashes.
346
+ - **`ASTSymbol`**: Extracted classes, functions, methods, variables, interfaces, and imports with line numbers.
347
+ - **`WorkspaceSummary`**: 5-level structured responsibilities with confidence scores.
348
+
349
+ The **Code Knowledge Graph** represents relationships:
350
+ - `CONTAINS` (Directory โ†’ File, File โ†’ Class)
351
+ - `DEFINES` (File โ†’ Function / Class)
352
+ - `IMPORTS` (File โ†’ Module)
353
+ - `CALLS` (Function โ†’ Function / Method)
354
+ - `INHERITS` (Class โ†’ Base Class)
355
+
356
+ ---
357
+
358
+ ## 9. ๐Ÿ”Œ Multi-Language AST Parser Plugin Architecture
359
+
360
+ WIA features dedicated parser plugins:
361
+ - **Python**: Full `ast` parsing for classes, async functions, decorators, method binding, docstrings, and call invocations.
362
+ - **TypeScript & JavaScript**: Extracts exported interfaces, types, ES6 classes, arrow functions, and imported modules.
363
+ - **Go**: Extracts package declarations, structs, interfaces, and method receivers.
364
+ - **Rust**: Extracts structs, enums, traits, implementations, and `pub fn` functions.
365
+ - **C / C++ / Java / C#**: Extracts class definitions, interfaces, methods, and header includes.
366
+
367
+ ---
368
+
369
+ ## 10. ๐Ÿ“Š 5-Level Hierarchical Workspace Summarization Engine
370
+
371
+ 1. **Level 1 (Function/Method)**: Deterministic purpose and signature.
372
+ 2. **Level 2 (File/Module)**: Primary responsibility and defined symbols.
373
+ 3. **Level 3 (Child Folder)**: Component domain grouping.
374
+ 4. **Level 4 (Parent Folder / Subsystem)**: Subsystem boundaries and architectural responsibility.
375
+ 5. **Level 5 (Repository Architecture)**: Executive repository purpose, tech stack, entry points.
376
+
377
+ ---
378
+
379
+ ## 11. ๐Ÿ” Hybrid Retrieval Engine & Query Planner
380
+
381
+ WIA combines multiple retrieval strategies:
382
+ - **Exact Symbol Lookup**: Instant index lookup for symbols matching query terms.
383
+ - **Lexical BM25 Search**: Matches identifiers, docstrings, and signatures.
384
+ - **Semantic Vector Search**: `SentenceTransformers` embeddings for conceptual queries.
385
+ - **Graph Traversal**: Inbound/outbound graph walks for callers, callees, and dependencies.
386
+
387
+ The **Query Planner** classifies query intent:
388
+ - `CODE_FLOW`: Traces call paths.
389
+ - `DEPENDENCY_IMPACT`: Calculates blast radius.
390
+ - `ONBOARDING`: Synthesizes walkthrough.
391
+ - `HEALTH_AUDIT`: Computes complexity metrics.
392
+ - `GENERAL_QA`: Synthesizes grounded answer.
393
+
394
+ ---
395
+
396
+ ## 12. ๐Ÿค– NVIDIA NIM AI Reasoning Provider
397
+
398
+ WIA uses **NVIDIA NIM (NeMo Inference Microservices)** as its primary LLM reasoning layer:
399
+
400
+ ```env
401
+ DEFAULT_LLM_PROVIDER=nvidia
402
+ NVIDIA_NIM_API_KEY=nvapi-your-key-here
403
+ NVIDIA_NIM_BASE_URL=https://integrate.api.nvidia.com/v1
404
+ NVIDIA_NIM_MODEL=meta/llama-3.1-70b-instruct
405
+ ```
406
+
407
+ - **Grounded Reasoning**: The LLM receives only retrieved repository facts, symbols, and graph context.
408
+ - **Offline Deterministic Fallback**: If NVIDIA NIM is not configured, deterministic analysis commands (`scan`, `architecture`, `symbols`, `flow`, `impact`, `export`) continue working seamlessly.
409
+
410
+ ---
411
+
412
+ ## 13. ๐Ÿ›ก๏ธ Provenance & Secret Safety Redaction
413
+
414
+ - **Strict Provenance**: WIA distinguishes `DETERMINISTIC_FACT` (parsed symbols, imports, lines) from `LLM_SUMMARY` (AI-generated text).
415
+ - **Secret Safety**: Sensitive files (`.env`, `.pem`, `.key`, `id_rsa`) and patterns (API keys, tokens) are redacted before constructing LLM context.
416
+
417
+ ---
418
+
419
+ ## 14. ๐Ÿ“ฆ Open Knowledge Format (OKF) Export
420
+
421
+ Export codebase intelligence into portable Markdown:
422
+ ```bash
423
+ wia export "My Project" --format okf --output ./
424
+ ```
425
+
426
+ Generates `.wia/knowledge/`:
427
+ ```
428
+ .wia/knowledge/
429
+ โ”œโ”€โ”€ index.md # Knowledge index & tech stack
430
+ โ”œโ”€โ”€ repository.md # Executive summary & entry points
431
+ โ”œโ”€โ”€ architecture.md # Subsystems breakdown
432
+ โ”œโ”€โ”€ subsystems/ # Subsystem deep dives
433
+ โ”œโ”€โ”€ modules/ # Per-file module guides
434
+ โ””โ”€โ”€ symbols/ # Defined symbols index
435
+ ```
436
+
437
+ ---
438
+
439
+ ## 15. โš™๏ธ Complete Configuration & Environment Variables (`.env`)
440
+
441
+ ```env
442
+ # ==============================================================================
443
+ # Workspace Intelligence Agent (WIA) - Environment Configuration
444
+ # ==============================================================================
445
+
446
+ DEFAULT_LLM_PROVIDER=nvidia
447
+ NVIDIA_NIM_API_KEY=your_nvidia_nim_api_key_here
448
+ NVIDIA_NIM_BASE_URL=https://integrate.api.nvidia.com/v1
449
+ NVIDIA_NIM_MODEL=meta/llama-3.1-70b-instruct
450
+
451
+ # Local Vector Embeddings (SentenceTransformers)
452
+ EMBEDDING_MODEL=all-MiniLM-L6-v2
453
+
454
+ # Server Configuration
455
+ WIA_HOST=127.0.0.1
456
+ WIA_PORT=8000
457
+ WIA_LOG_LEVEL=INFO
458
+ ```
459
+
460
+ ---
461
+
462
+ ## 16. ๐Ÿงช Automated Testing Suite
463
+
464
+ Run the full automated pytest suite (26 unit & integration tests, 55% measured test coverage):
465
+
466
+ ```bash
467
+ # Run pytest with coverage
468
+ pytest --cov=app
469
+
470
+ # Or via WIA CLI
471
+ wia test
472
+ ```
473
+
474
+ ### Verified Test Suites
475
+ - `test_api_endpoints.py`: Tests all REST API endpoints with SQLite memory pool.
476
+ - `test_ast_multilang.py`: Validates Python, TypeScript, Go, Rust, and C++ AST symbol extraction.
477
+ - `test_knowledge_graph.py`: Validates BFS call tracing, impact analysis, and graph edges.
478
+ - `test_hybrid_retrieval.py`: Validates Query Planner intents, secret redaction, and OKF export.
479
+ - `test_nvidia_nim_provider.py`: Validates NVIDIA NIM provider request building, authentication, and fallback.
480
+ - `test_wia_pipeline.py`: Validates crawler, AST parser, hierarchical summarizer, and agent.
481
+
482
+ ---
483
+
484
+ ## 17. โ“ Troubleshooting & FAQ
485
+
486
+ **Q: Do I need an OpenAI / Gemini API key to use WIA?**
487
+ A: No. WIA uses NVIDIA NIM as its primary AI provider. If no LLM keys are provided, deterministic commands (`scan`, `architecture`, `symbols`, `flow`, `impact`, `export`) continue working completely.
488
+
489
+ **Q: How does the VS Code extension connect to WIA?**
490
+ A: Start the daemon with `wia serve` (or `python run_dev.py`). The VS Code extension connects to `http://127.0.0.1:8000`.
491
+
492
+ **Q: Are my API keys or source code secrets uploaded anywhere?**
493
+ A: No. Secrets in `.env` files and recognized API keys are automatically redacted locally before constructing any LLM prompts.
494
+
495
+ ---
496
+
497
+ ## 18. ๐Ÿ“š Documentation Index
498
+
499
+ - [System Architecture Details](docs/ARCHITECTURE.md)
500
+ - [Workspace Knowledge Model](docs/KNOWLEDGE_MODEL.md)
501
+ - [Hybrid Retrieval Engine](docs/RETRIEVAL.md)
502
+ - [Provenance & Citations](docs/PROVENANCE.md)
503
+ - [AI Architecture & NVIDIA NIM](docs/AI_ARCHITECTURE.md)
504
+ - [Python Packaging Guide](docs/PACKAGING.md)
505
+ - [VS Code Extension Developer Guide](docs/VSCODE_EXTENSION.md)
506
+ - [Open Knowledge Format Export](docs/OKF_EXPORT.md)
507
+ - [REST API Specification](docs/API.md)
508
+ - [CLI User Manual](docs/CLI.md)
509
+ - [Hierarchical Summarization Guide](docs/HIERARCHICAL_SUMMARIZATION.md)
510
+
511
+ ---
512
+
513
+ ## 19. ๐Ÿ“„ License
514
+
515
+ This project is licensed under the MIT License.